style: Format code with linter

This commit is contained in:
Paul Gauthier (aider) 2025-03-05 18:42:13 -08:00
parent 85b9bdd8f4
commit 96bde4ad03
2 changed files with 14 additions and 8 deletions

View file

@ -691,8 +691,11 @@ 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.validate_environment.return_value = {"missing_keys": [], "keys_in_environment": []} mock_model.return_value.validate_environment.return_value = {
"missing_keys": [],
"keys_in_environment": [],
}
main( main(
["--no-verify-ssl", "--exit", "--yes"], ["--no-verify-ssl", "--exit", "--yes"],
input=DummyInput(), input=DummyInput(),

View file

@ -29,13 +29,16 @@ class TestSSLVerification(TestCase):
# Mock the litellm._lazy_module to avoid AttributeError # Mock the litellm._lazy_module to avoid AttributeError
mock_load_litellm.return_value = None mock_load_litellm.return_value = None
mock_module = MagicMock() mock_module = MagicMock()
# Mock Model class to avoid actual model initialization # Mock Model class to avoid actual model initialization
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.validate_environment.return_value = {"missing_keys": [], "keys_in_environment": []} mock_model.return_value.validate_environment.return_value = {
"missing_keys": [],
"keys_in_environment": [],
}
with patch("aider.llm.litellm._lazy_module", mock_module): with patch("aider.llm.litellm._lazy_module", mock_module):
# Run main with --no-verify-ssl flag # Run main with --no-verify-ssl flag
main( main(
@ -43,14 +46,14 @@ class TestSSLVerification(TestCase):
input=DummyInput(), input=DummyInput(),
output=DummyOutput(), output=DummyOutput(),
) )
# Verify model_info_manager.set_verify_ssl was called with False # Verify model_info_manager.set_verify_ssl was called with False
mock_set_verify_ssl.assert_called_once_with(False) mock_set_verify_ssl.assert_called_once_with(False)
# Verify httpx clients were created with verify=False # Verify httpx clients were created with verify=False
mock_client.assert_called_once_with(verify=False) mock_client.assert_called_once_with(verify=False)
mock_async_client.assert_called_once_with(verify=False) mock_async_client.assert_called_once_with(verify=False)
# Verify SSL_VERIFY environment variable was set to empty string # Verify SSL_VERIFY environment variable was set to empty string
self.assertEqual(os.environ.get("SSL_VERIFY"), "") self.assertEqual(os.environ.get("SSL_VERIFY"), "")