mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 04:44:59 +00:00
fix: Use call_args_list to verify all calls to mocked function
This commit is contained in:
parent
100cca5dbf
commit
427a83b075
1 changed files with 8 additions and 4 deletions
|
@ -125,11 +125,15 @@ class TestRepo(unittest.TestCase):
|
|||
# Check that simple_send_with_retries was called twice
|
||||
self.assertEqual(mock_send.call_count, 2)
|
||||
|
||||
dump(mock_send.call_args)
|
||||
|
||||
# Check that it was called with the correct model names
|
||||
mock_send.assert_any_call(model1.name, mock_send.call_args[0][1])
|
||||
mock_send.assert_any_call(model2.name, mock_send.call_args[0][1])
|
||||
self.assertEqual(mock_send.call_args_list[0][0][0], model1.name)
|
||||
self.assertEqual(mock_send.call_args_list[1][0][0], model2.name)
|
||||
|
||||
# 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)
|
||||
|
||||
@patch("aider.repo.simple_send_with_retries")
|
||||
def test_get_commit_message_strip_quotes(self, mock_send):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue