diff --git a/tests/test_coder.py b/tests/test_coder.py index 8689f863f..9f37dc022 100644 --- a/tests/test_coder.py +++ b/tests/test_coder.py @@ -33,10 +33,12 @@ class TestCoder(unittest.TestCase): self.assertTrue(fname.exists()) + # 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.head.commit.message - # Check that the latest commit message contains the filename - self.assertIn(str(fname), 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)}") def test_allowed_to_edit(self):