mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
test: add tests for --suggest-shell-commands option
This commit is contained in:
parent
6f70cb3780
commit
a41ad9e778
1 changed files with 30 additions and 0 deletions
|
@ -599,3 +599,33 @@ class TestMain(TestCase):
|
|||
|
||||
# shell commands require explicit approval, not just --yes
|
||||
self.assertFalse(Path("file.txt").exists())
|
||||
|
||||
def test_suggest_shell_commands_default(self):
|
||||
with GitTemporaryDirectory():
|
||||
coder = main(
|
||||
["--exit", "--yes"],
|
||||
input=DummyInput(),
|
||||
output=DummyOutput(),
|
||||
return_coder=True,
|
||||
)
|
||||
self.assertTrue(coder.suggest_shell_commands)
|
||||
|
||||
def test_suggest_shell_commands_disabled(self):
|
||||
with GitTemporaryDirectory():
|
||||
coder = main(
|
||||
["--no-suggest-shell-commands", "--exit", "--yes"],
|
||||
input=DummyInput(),
|
||||
output=DummyOutput(),
|
||||
return_coder=True,
|
||||
)
|
||||
self.assertFalse(coder.suggest_shell_commands)
|
||||
|
||||
def test_suggest_shell_commands_enabled(self):
|
||||
with GitTemporaryDirectory():
|
||||
coder = main(
|
||||
["--suggest-shell-commands", "--exit", "--yes"],
|
||||
input=DummyInput(),
|
||||
output=DummyOutput(),
|
||||
return_coder=True,
|
||||
)
|
||||
self.assertTrue(coder.suggest_shell_commands)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue