fix: Resolve MagicMock TypeError in test_no_verify_ssl_sets_model_info_manager

This commit is contained in:
Paul Gauthier (aider) 2025-03-05 18:55:17 -08:00
parent 5cf6945bcb
commit 8e2246ec5c

View file

@ -691,11 +691,15 @@ class TestMain(TestCase):
with patch("aider.models.Model") as mock_model:
# Configure the mock to avoid the TypeError
mock_model.return_value.info = {}
mock_model.return_value.name = "gpt-4" # Add a string name
mock_model.return_value.validate_environment.return_value = {
"missing_keys": [],
"keys_in_environment": [],
}
# Mock fuzzy_match_models to avoid string operations on MagicMock
with patch("aider.models.fuzzy_match_models", return_value=[]):
main(
["--no-verify-ssl", "--exit", "--yes"],
input=DummyInput(),