mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 12:55:00 +00:00
test: Fix assertion errors in commit message tests for mock calls
This commit is contained in:
parent
b4084484ff
commit
606fce65ab
1 changed files with 6 additions and 11 deletions
|
@ -125,15 +125,10 @@ class TestRepo(unittest.TestCase):
|
|||
# Check that simple_send_with_retries was called twice
|
||||
self.assertEqual(mock_send.call_count, 2)
|
||||
|
||||
# Check that it was called with the correct models
|
||||
self.assertEqual(mock_send.call_args_list[0][0][0], model1)
|
||||
self.assertEqual(mock_send.call_args_list[1][0][0], model2)
|
||||
|
||||
# Check that the content of the messages is the same for both calls
|
||||
self.assertEqual(mock_send.call_args_list[0][0][1], mock_send.call_args_list[1][0][1])
|
||||
|
||||
# Optionally, you can still dump the call args if needed for debugging
|
||||
dump(mock_send.call_args_list)
|
||||
# Check that both calls were made with the same messages
|
||||
first_call_messages = mock_send.call_args_list[0][0][0] # Get messages from first call
|
||||
second_call_messages = mock_send.call_args_list[1][0][0] # Get messages from second call
|
||||
self.assertEqual(first_call_messages, second_call_messages)
|
||||
|
||||
@patch("aider.models.Model.simple_send_with_retries")
|
||||
def test_get_commit_message_strip_quotes(self, mock_send):
|
||||
|
@ -167,8 +162,8 @@ class TestRepo(unittest.TestCase):
|
|||
|
||||
self.assertEqual(result, "Custom commit message")
|
||||
mock_send.assert_called_once()
|
||||
args, _ = mock_send.call_args
|
||||
self.assertEqual(args[1][0]["content"], custom_prompt)
|
||||
args = mock_send.call_args[0] # Get positional args
|
||||
self.assertEqual(args[0][0]["content"], custom_prompt) # Check first message content
|
||||
|
||||
@patch("aider.repo.GitRepo.get_commit_message")
|
||||
def test_commit_with_custom_committer_name(self, mock_send):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue