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