mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
feat: Add test for multiple commits in cmd_diff
This commit is contained in:
parent
65526baeef
commit
ce64f7e1b7
1 changed files with 8 additions and 3 deletions
|
@ -823,6 +823,12 @@ class TestCommands(TestCase):
|
||||||
# Run cmd_commit
|
# Run cmd_commit
|
||||||
commands.cmd_commit()
|
commands.cmd_commit()
|
||||||
|
|
||||||
|
# Modify the file again
|
||||||
|
file_path.write_text("Further modified content")
|
||||||
|
|
||||||
|
# Run cmd_commit again
|
||||||
|
commands.cmd_commit()
|
||||||
|
|
||||||
# Capture the output of cmd_diff
|
# Capture the output of cmd_diff
|
||||||
with mock.patch("builtins.print") as mock_print:
|
with mock.patch("builtins.print") as mock_print:
|
||||||
commands.cmd_diff("")
|
commands.cmd_diff("")
|
||||||
|
@ -830,9 +836,8 @@ class TestCommands(TestCase):
|
||||||
# Check if the diff output is correct
|
# Check if the diff output is correct
|
||||||
mock_print.assert_called_with(mock.ANY)
|
mock_print.assert_called_with(mock.ANY)
|
||||||
diff_output = mock_print.call_args[0][0]
|
diff_output = mock_print.call_args[0][0]
|
||||||
self.assertIn("-Initial content", diff_output)
|
self.assertIn("-Modified content", diff_output)
|
||||||
self.assertIn("+Modified content", diff_output)
|
self.assertIn("+Further modified content", diff_output)
|
||||||
dump(diff_output)
|
|
||||||
|
|
||||||
def test_cmd_ask(self):
|
def test_cmd_ask(self):
|
||||||
io = InputOutput(pretty=False, yes=True)
|
io = InputOutput(pretty=False, yes=True)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue