test: update assertions for shell command suggestion behavior

This commit is contained in:
Paul Gauthier 2024-08-27 13:56:58 -07:00 committed by Paul Gauthier (aider)
parent 59cc799b0d
commit 6a55708357

View file

@ -637,31 +637,23 @@ class TestMain(TestCase):
with patch("aider.io.InputOutput.confirm_ask") as mock_confirm_ask: with patch("aider.io.InputOutput.confirm_ask") as mock_confirm_ask:
main( main(
["--apply", "shell.md", "--no-suggest-shell-commands"], ["--apply", "shell.md", "--no-git"],
# 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"],
# input=DummyInput(), # input=DummyInput(),
# output=DummyOutput(), # output=DummyOutput(),
) )
# Make sure confirm_ask IS called when --no-suggest-shell-commands is not used # Make sure confirm_ask IS called when --no-suggest-shell-commands is not used
mock_confirm_ask.assert_called_once() mock_confirm_ask.assert_called_once()
print(
"confirm_ask args (without --no-suggest-shell-commands):", with patch("aider.io.InputOutput.confirm_ask") as mock_confirm_ask:
mock_confirm_ask.call_args, 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 # Check that the file was not created in either case
self.assertFalse(Path("no_suggest_file.txt").exists()) self.assertFalse(Path("no_suggest_file.txt").exists())