mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
Fixes #374 - test_main.py += unit test for --message flag.
Fixes https://github.com/paul-gauthier/aider/issues/374
This commit is contained in:
parent
015ffa13e1
commit
3e81cb1c6b
1 changed files with 10 additions and 0 deletions
|
@ -196,3 +196,13 @@ class TestMain(TestCase):
|
||||||
MockSend.side_effect = side_effect
|
MockSend.side_effect = side_effect
|
||||||
|
|
||||||
main(["--yes", fname, "--encoding", "iso-8859-15"])
|
main(["--yes", fname, "--encoding", "iso-8859-15"])
|
||||||
|
@patch("aider.main.InputOutput")
|
||||||
|
@patch("openai.ChatCompletion.create")
|
||||||
|
def test_main_message_adds_to_input_history(self, mock_chat_completion, MockInputOutput):
|
||||||
|
test_message = "test message"
|
||||||
|
mock_io_instance = MockInputOutput.return_value
|
||||||
|
mock_chat_completion.return_value = MagicMock(choices=[{"text": "mocked response"}])
|
||||||
|
|
||||||
|
main(["--message", test_message], input=DummyInput(), output=DummyOutput())
|
||||||
|
|
||||||
|
mock_io_instance.add_to_input_history.assert_called_once_with(test_message)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue