From 6a55708357890e25a4d666e2267b7e7216371a34 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 27 Aug 2024 13:56:58 -0700 Subject: [PATCH] test: update assertions for shell command suggestion behavior --- tests/basic/test_main.py | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index 3ce341323..c84b7c1c8 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -637,31 +637,23 @@ class TestMain(TestCase): with patch("aider.io.InputOutput.confirm_ask") as mock_confirm_ask: main( - ["--apply", "shell.md", "--no-suggest-shell-commands"], - # input=DummyInput(), - # output=DummyOutput(), - ) - - # Make sure confirm_ask is not called when --no-suggest-shell-commands is used - mock_confirm_ask.assert_called_once() - print( - "confirm_ask args (with --no-suggest-shell-commands):", - mock_confirm_ask.call_args, - ) - - with patch("aider.io.InputOutput.confirm_ask") as mock_confirm_ask: - main( - ["--apply", "shell.md"], + ["--apply", "shell.md", "--no-git"], # input=DummyInput(), # output=DummyOutput(), ) # Make sure confirm_ask IS called when --no-suggest-shell-commands is not used mock_confirm_ask.assert_called_once() - print( - "confirm_ask args (without --no-suggest-shell-commands):", - mock_confirm_ask.call_args, + + with patch("aider.io.InputOutput.confirm_ask") as mock_confirm_ask: + main( + ["--apply", "shell.md", "--no-suggest-shell-commands", "--no-git"], + # input=DummyInput(), + # output=DummyOutput(), ) + # Make sure confirm_ask is not called when --no-suggest-shell-commands is used + mock_confirm_ask.assert_not_called() + # Check that the file was not created in either case self.assertFalse(Path("no_suggest_file.txt").exists())