mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 00:05:01 +00:00
Improvements: flag -f (not -mf); unitest improvements.
This commit is contained in:
parent
13ac5f0b60
commit
4692a689fe
2 changed files with 5 additions and 7 deletions
|
@ -182,16 +182,15 @@ class TestMain(TestCase):
|
|||
_, kwargs = MockCoder.call_args
|
||||
assert kwargs["dirty_commits"] is True
|
||||
|
||||
@patch('aider.main.InputOutput.confirm_ask', return_value=True)
|
||||
def test_message_file_flag(self, mock_confirm):
|
||||
def test_message_file_flag(self):
|
||||
message_file_content = "This is a test message from a file."
|
||||
message_file_path = "test_message.txt"
|
||||
message_file_path = tempfile.mktemp()
|
||||
with open(message_file_path, 'w', encoding='utf-8') as message_file:
|
||||
message_file.write(message_file_content)
|
||||
|
||||
with patch("aider.main.Coder.create") as MockCoder:
|
||||
MockCoder.return_value.run = MagicMock()
|
||||
main(["--message-file", message_file_path], input=DummyInput(), output=DummyOutput())
|
||||
main(["--yes", "--message-file", message_file_path], input=DummyInput(), output=DummyOutput())
|
||||
MockCoder.return_value.run.assert_called_once_with(with_message=message_file_content)
|
||||
|
||||
os.remove(message_file_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue