mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
test: update invalid edit format test to check return code instead of SystemExit
This commit is contained in:
parent
743f0f5540
commit
b70e0bd1f6
1 changed files with 6 additions and 6 deletions
|
@ -670,12 +670,12 @@ class TestMain(TestCase):
|
|||
def test_invalid_edit_format(self):
|
||||
with GitTemporaryDirectory():
|
||||
with patch("aider.io.InputOutput.offer_url") as mock_offer_url:
|
||||
with self.assertRaises(SystemExit):
|
||||
main(
|
||||
result = main(
|
||||
["--edit-format", "not-a-real-format", "--exit", "--yes"],
|
||||
input=DummyInput(),
|
||||
output=DummyOutput(),
|
||||
)
|
||||
self.assertEqual(result, 1) # main() should return 1 on error
|
||||
mock_offer_url.assert_called_once()
|
||||
args, _ = mock_offer_url.call_args
|
||||
self.assertEqual(args[0], "https://aider.chat/docs/edit-formats.html")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue