mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
test: Fix assertion failure and type error in onboarding tests
This commit is contained in:
parent
87090139f6
commit
eacf3cc4ed
1 changed files with 3 additions and 4 deletions
|
@ -364,9 +364,9 @@ class TestOnboarding(unittest.TestCase):
|
||||||
self.assertEqual(selected_model, "openrouter/google/gemini-2.5-pro-exp-03-25:free")
|
self.assertEqual(selected_model, "openrouter/google/gemini-2.5-pro-exp-03-25:free")
|
||||||
self.assertEqual(mock_try_select.call_count, 2) # Called before and after oauth
|
self.assertEqual(mock_try_select.call_count, 2) # Called before and after oauth
|
||||||
mock_offer_oauth.assert_called_once_with(io_mock, analytics_mock)
|
mock_offer_oauth.assert_called_once_with(io_mock, analytics_mock)
|
||||||
# First warning about no keys, second about using the model found after OAuth
|
# Only one warning is expected: "No LLM model..."
|
||||||
self.assertEqual(io_mock.tool_warning.call_count, 2)
|
self.assertEqual(io_mock.tool_warning.call_count, 1)
|
||||||
io_mock.tool_warning.assert_any_call(
|
io_mock.tool_warning.assert_called_once_with(
|
||||||
"No LLM model was specified and no API keys were provided."
|
"No LLM model was specified and no API keys were provided."
|
||||||
)
|
)
|
||||||
# The second call to try_select finds the model, so the *outer* function logs the usage.
|
# The second call to try_select finds the model, so the *outer* function logs the usage.
|
||||||
|
@ -447,7 +447,6 @@ class TestOnboarding(unittest.TestCase):
|
||||||
@patch.dict(os.environ, {}, clear=True) # Start with clean env
|
@patch.dict(os.environ, {}, clear=True) # Start with clean env
|
||||||
def test_start_openrouter_oauth_flow_success_path(
|
def test_start_openrouter_oauth_flow_success_path(
|
||||||
self,
|
self,
|
||||||
mock_env,
|
|
||||||
mock_open_file,
|
mock_open_file,
|
||||||
mock_makedirs,
|
mock_makedirs,
|
||||||
mock_exchange,
|
mock_exchange,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue