mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
style: Format test_deprecated.py with black
This commit is contained in:
parent
5447483da2
commit
9e668cda7f
1 changed files with 29 additions and 25 deletions
|
@ -5,8 +5,8 @@ from unittest.mock import MagicMock, patch
|
|||
from prompt_toolkit.input import DummyInput
|
||||
from prompt_toolkit.output import DummyOutput
|
||||
|
||||
from aider.main import main
|
||||
from aider.deprecated import handle_deprecated_model_args
|
||||
from aider.main import main
|
||||
|
||||
|
||||
class TestDeprecated(TestCase):
|
||||
|
@ -34,20 +34,22 @@ class TestDeprecated(TestCase):
|
|||
"--3",
|
||||
"--deepseek",
|
||||
"--o1-mini",
|
||||
"--o1-preview"
|
||||
"--o1-preview",
|
||||
]
|
||||
|
||||
for flag in deprecated_flags:
|
||||
mock_tool_warning.reset_mock()
|
||||
|
||||
with patch("aider.models.Model"), self.subTest(flag=flag):
|
||||
main([flag, "--no-git", "--exit", "--yes"], input=DummyInput(), output=DummyOutput())
|
||||
main(
|
||||
[flag, "--no-git", "--exit", "--yes"], input=DummyInput(), output=DummyOutput()
|
||||
)
|
||||
|
||||
mock_tool_warning.assert_called_once()
|
||||
warning_msg = mock_tool_warning.call_args[0][0]
|
||||
|
||||
# Remove any leading hyphens for the comparison
|
||||
flag_in_msg = flag.lstrip('-')
|
||||
flag_in_msg = flag.lstrip("-")
|
||||
|
||||
self.assertIn(flag_in_msg, warning_msg)
|
||||
self.assertIn("deprecated", warning_msg)
|
||||
|
@ -58,7 +60,9 @@ class TestDeprecated(TestCase):
|
|||
# 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"):
|
||||
main(["--4", "--no-git", "--exit", "--yes"], input=DummyInput(), output=DummyOutput())
|
||||
main(
|
||||
["--4", "--no-git", "--exit", "--yes"], input=DummyInput(), output=DummyOutput()
|
||||
)
|
||||
|
||||
mock_tool_warning.assert_called_once()
|
||||
warning_msg = mock_tool_warning.call_args[0][0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue