mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 12:55:00 +00:00
Add test for cmd_run method to handle unbound local error
This commit is contained in:
parent
c0a2b8b57c
commit
11facfe4d5
1 changed files with 4 additions and 4 deletions
|
@ -536,7 +536,7 @@ class TestCommands(TestCase):
|
|||
commands.cmd_add("file.txt")
|
||||
self.assertEqual(coder.abs_fnames, set())
|
||||
|
||||
def test_cmd_run_unbound_local_error(self):
|
||||
def test_cmd_test_unbound_local_error(self):
|
||||
with ChdirTemporaryDirectory():
|
||||
io = InputOutput(pretty=False, yes=False)
|
||||
from aider.coders import Coder
|
||||
|
@ -545,11 +545,11 @@ class TestCommands(TestCase):
|
|||
commands = Commands(io, coder)
|
||||
|
||||
# Mock the io.prompt_ask method to simulate user input
|
||||
io.prompt_ask = lambda *args, **kwargs: "custom instructions"
|
||||
io.prompt_ask = lambda *args, **kwargs: "y"
|
||||
|
||||
# Test the cmd_run method with a command that should not raise an error
|
||||
result = commands.cmd_run("echo test", add_on_nonzero_exit=False)
|
||||
self.assertIsNone(result, "cmd_run should return None without raising an error")
|
||||
result = commands.cmd_run("exit 1", add_on_nonzero_exit=True)
|
||||
self.assertTrue("I ran this comand" in result)
|
||||
|
||||
def test_cmd_add_drop_untracked_files(self):
|
||||
with GitTemporaryDirectory():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue