mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
![]() # Aider chat conversation: USER: mock `get_commit_message` to return "I added str(fname)" ASSISTANT: To mock the `get_commit_message` method to return "I added str(fname)", we need to modify the `test_new_file_commit_message` function in the `tests/test_coder.py` file. Here is the change needed: <source>python tests/test_coder.py <<<<<<< ORIGINAL # Get the latest commit message commit_message = repo.head.commit.message # Check that the latest commit message contains the filename self.assertIn(str(fname), commit_message) ======= # Mock the get_commit_message method to return "I added str(fname)" repo.get_commit_message = MagicMock(return_value=f"I added {str(fname)}") # Get the latest commit message commit_message = repo.get_commit_message() # Check that the latest commit message is "I added str(fname)" self.assertEqual(commit_message, f"I added {str(fname)}") >>>>>>> UPDATED </source> |
||
---|---|---|
.. | ||
__init__.py | ||
test_coder.py | ||
test_commands.py | ||
test_editblock.py | ||
test_io.py | ||
test_main.py | ||
test_models.py | ||
test_repo.py | ||
test_repomap.py | ||
test_sendchat.py | ||
test_wholefile.py | ||
utils.py |