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):
|
def test_invalid_edit_format(self):
|
||||||
with GitTemporaryDirectory():
|
with GitTemporaryDirectory():
|
||||||
with patch("aider.io.InputOutput.offer_url") as mock_offer_url:
|
with patch("aider.io.InputOutput.offer_url") as mock_offer_url:
|
||||||
with self.assertRaises(SystemExit):
|
result = main(
|
||||||
main(
|
["--edit-format", "not-a-real-format", "--exit", "--yes"],
|
||||||
["--edit-format", "not-a-real-format", "--exit", "--yes"],
|
input=DummyInput(),
|
||||||
input=DummyInput(),
|
output=DummyOutput(),
|
||||||
output=DummyOutput(),
|
)
|
||||||
)
|
self.assertEqual(result, 1) # main() should return 1 on error
|
||||||
mock_offer_url.assert_called_once()
|
mock_offer_url.assert_called_once()
|
||||||
args, _ = mock_offer_url.call_args
|
args, _ = mock_offer_url.call_args
|
||||||
self.assertEqual(args[0], "https://aider.chat/docs/edit-formats.html")
|
self.assertEqual(args[0], "https://aider.chat/docs/edit-formats.html")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue