From 875fb3a17873c56b77e745258b0ec6202d579970 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 2 Oct 2024 11:21:13 -0700 Subject: [PATCH] test: update sanity_check_models_bogus_editor to expect two warnings --- tests/basic/test_models.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/basic/test_models.py b/tests/basic/test_models.py index 8d75d9e68..a81050963 100644 --- a/tests/basic/test_models.py +++ b/tests/basic/test_models.py @@ -69,14 +69,11 @@ class TestModels(unittest.TestCase): result = sanity_check_models(mock_io, main_model) - self.assertTrue( - result - ) # Should return True because there's a problem with the editor model - mock_io.tool_warning.assert_called_once() # Ensure a warning was issued - warning_message = mock_io.tool_warning.call_args[0][0] - self.assertIn( - "bogus-model", warning_message - ) # Check that the warning mentions the bogus model + self.assertTrue(result) # Should return True because there's a problem with the editor model + mock_io.tool_warning.assert_called_with(ANY) # Ensure a warning was issued + self.assertEqual(mock_io.tool_warning.call_count, 2) # Expect two warnings + warning_messages = [call.args[0] for call in mock_io.tool_warning.call_args_list] + self.assertTrue(any("bogus-model" in msg for msg in warning_messages)) # Check that one of the warnings mentions the bogus model if __name__ == "__main__":