mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 04:44:59 +00:00
added test coverage #585
This commit is contained in:
parent
0de6b36cde
commit
250d89649b
2 changed files with 19 additions and 1 deletions
|
@ -219,7 +219,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
|||
args.assistant_output_color = "blue"
|
||||
args.code_theme = "default"
|
||||
|
||||
if return_coder:
|
||||
if return_coder and args.yes is None:
|
||||
args.yes = True
|
||||
|
||||
io = InputOutput(
|
||||
|
|
|
@ -219,3 +219,21 @@ class TestMain(TestCase):
|
|||
main(["--message", test_message], input=DummyInput(), output=DummyOutput())
|
||||
|
||||
mock_io_instance.add_to_input_history.assert_called_once_with(test_message)
|
||||
|
||||
@patch("aider.main.InputOutput")
|
||||
@patch("aider.coders.base_coder.Coder.run")
|
||||
def test_yes(self, mock_run, MockInputOutput):
|
||||
test_message = "test message"
|
||||
|
||||
main(["--yes", "--message", test_message])
|
||||
args, kwargs = MockInputOutput.call_args
|
||||
self.assertTrue(args[1])
|
||||
|
||||
@patch("aider.main.InputOutput")
|
||||
@patch("aider.coders.base_coder.Coder.run")
|
||||
def test_default_yes(self, mock_run, MockInputOutput):
|
||||
test_message = "test message"
|
||||
|
||||
main(["--message", test_message])
|
||||
args, kwargs = MockInputOutput.call_args
|
||||
self.assertEqual(args[1], None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue