mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
test: mock URL launches in deprecated args tests
This commit is contained in:
parent
4755578822
commit
e6623ae0a8
1 changed files with 8 additions and 2 deletions
|
@ -21,7 +21,10 @@ class TestDeprecated(TestCase):
|
||||||
os.environ.update(self.original_env)
|
os.environ.update(self.original_env)
|
||||||
|
|
||||||
@patch("aider.io.InputOutput.tool_warning")
|
@patch("aider.io.InputOutput.tool_warning")
|
||||||
def test_deprecated_args_show_warnings(self, mock_tool_warning):
|
@patch("aider.io.InputOutput.offer_url")
|
||||||
|
def test_deprecated_args_show_warnings(self, mock_offer_url, mock_tool_warning):
|
||||||
|
# Prevent URL launches during tests
|
||||||
|
mock_offer_url.return_value = False
|
||||||
# Test all deprecated flags to ensure they show warnings
|
# Test all deprecated flags to ensure they show warnings
|
||||||
deprecated_flags = [
|
deprecated_flags = [
|
||||||
"--opus",
|
"--opus",
|
||||||
|
@ -65,7 +68,10 @@ class TestDeprecated(TestCase):
|
||||||
self.assertIn("use --model", warning_msg.lower())
|
self.assertIn("use --model", warning_msg.lower())
|
||||||
|
|
||||||
@patch("aider.io.InputOutput.tool_warning")
|
@patch("aider.io.InputOutput.tool_warning")
|
||||||
def test_model_alias_in_warning(self, mock_tool_warning):
|
@patch("aider.io.InputOutput.offer_url")
|
||||||
|
def test_model_alias_in_warning(self, mock_offer_url, mock_tool_warning):
|
||||||
|
# Prevent URL launches during tests
|
||||||
|
mock_offer_url.return_value = False
|
||||||
# Test that the warning uses the model alias if available
|
# Test that the warning uses the model alias if available
|
||||||
with patch("aider.models.MODEL_ALIASES", {"gpt4": "gpt-4-0613"}):
|
with patch("aider.models.MODEL_ALIASES", {"gpt4": "gpt-4-0613"}):
|
||||||
with patch("aider.models.Model"):
|
with patch("aider.models.Model"):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue