aider/tests
Paul Gauthier 20c7eb549c aider: Mocked get_commit_message to return "I added str(fname)".
# 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>
2023-08-08 08:01:15 -03:00
..
__init__.py aider: Added empty __init__.py file to tests directory to fix ModuleNotFoundError when running tests. 2023-05-11 17:12:42 -07:00
test_coder.py aider: Mocked get_commit_message to return "I added str(fname)". 2023-08-08 08:01:15 -03:00
test_commands.py Fixed /commit after repo refactor, added test coverage 2023-08-04 06:39:04 -03:00
test_editblock.py added test_replace_part_with_missing_varied_leading_whitespace 2023-07-18 15:13:14 -03:00
test_io.py Fix test 2023-07-10 15:33:46 -07:00
test_main.py tests and bugfix 2023-07-24 17:47:53 -03:00
test_models.py More Model test cases 2023-06-21 14:13:34 -07:00
test_repo.py aider: Add None as the third argument in all calls to GitRepo. 2023-07-24 17:32:09 -03:00
test_repomap.py linting 2023-07-21 16:08:50 -03:00
test_sendchat.py move tests to test_sendchat.py 2023-07-21 14:17:14 -03:00
test_wholefile.py updated tests 2023-07-11 15:17:00 -07:00
utils.py tests and bugfix 2023-07-24 17:47:53 -03:00