From d01e9ef7a4833f71948f1b1dc318b05db4eada81 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 27 Aug 2024 13:56:59 -0700 Subject: [PATCH] test: update shell command handling checks in test_apply_shell_commands_with_no_suggest --- tests/basic/test_main.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index c84b7c1c8..97e645d5e 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -635,25 +635,25 @@ class TestMain(TestCase): shell_md = Path("shell.md") shell_md.write_text("```bash\ntouch no_suggest_file.txt\n```") - with patch("aider.io.InputOutput.confirm_ask") as mock_confirm_ask: + with patch("aider.coders.base_coder.Coder.handle_shell_commands") as mock_handle_shell_commands: main( ["--apply", "shell.md", "--no-git"], - # input=DummyInput(), - # output=DummyOutput(), + input=DummyInput(), + output=DummyOutput(), ) - # Make sure confirm_ask IS called when --no-suggest-shell-commands is not used - mock_confirm_ask.assert_called_once() + # Make sure handle_shell_commands IS called when --no-suggest-shell-commands is not used + mock_handle_shell_commands.assert_called_once() - with patch("aider.io.InputOutput.confirm_ask") as mock_confirm_ask: + with patch("aider.coders.base_coder.Coder.handle_shell_commands") as mock_handle_shell_commands: main( ["--apply", "shell.md", "--no-suggest-shell-commands", "--no-git"], - # input=DummyInput(), - # output=DummyOutput(), + input=DummyInput(), + output=DummyOutput(), ) - # Make sure confirm_ask is not called when --no-suggest-shell-commands is used - mock_confirm_ask.assert_not_called() + # Make sure handle_shell_commands is not called when --no-suggest-shell-commands is used + mock_handle_shell_commands.assert_not_called() # Check that the file was not created in either case self.assertFalse(Path("no_suggest_file.txt").exists())