test: update test assertions to check model objects instead of names

This commit is contained in:
Paul Gauthier (aider) 2024-12-07 13:38:57 -08:00
parent ccf460c1f7
commit c9c2d5ab6f
2 changed files with 6 additions and 6 deletions

View file

@ -91,9 +91,9 @@ class TestChatSummary(TestCase):
# Check that both models were tried # Check that both models were tried
self.assertEqual(mock_send.call_count, 2) self.assertEqual(mock_send.call_count, 2)
# Check that the calls were made with the correct model names # Check that the calls were made with the correct models
self.assertEqual(mock_send.call_args_list[0][0][0], "gpt-4") self.assertEqual(mock_send.call_args_list[0][0][0], mock_model1)
self.assertEqual(mock_send.call_args_list[1][0][0], "gpt-3.5-turbo") self.assertEqual(mock_send.call_args_list[1][0][0], mock_model2)
# Check that we got a summary from the second model # Check that we got a summary from the second model
self.assertEqual( self.assertEqual(

View file

@ -125,9 +125,9 @@ class TestRepo(unittest.TestCase):
# Check that simple_send_with_retries was called twice # Check that simple_send_with_retries was called twice
self.assertEqual(mock_send.call_count, 2) self.assertEqual(mock_send.call_count, 2)
# Check that it was called with the correct model names # Check that it was called with the correct models
self.assertEqual(mock_send.call_args_list[0][0][0], model1.name) self.assertEqual(mock_send.call_args_list[0][0][0], model1)
self.assertEqual(mock_send.call_args_list[1][0][0], model2.name) self.assertEqual(mock_send.call_args_list[1][0][0], model2)
# Check that the content of the messages is the same for both calls # 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]) self.assertEqual(mock_send.call_args_list[0][0][1], mock_send.call_args_list[1][0][1])