mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
style: Fix import order in test_models.py
This commit is contained in:
parent
abf19a61cf
commit
f74fa16e4a
1 changed files with 10 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
import unittest
|
||||
from unittest.mock import patch, MagicMock
|
||||
import os
|
||||
import unittest
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from aider.models import Model, get_model_info, sanity_check_model
|
||||
|
||||
|
@ -29,7 +29,7 @@ class TestModels(unittest.TestCase):
|
|||
model = Model("gpt-4-0613")
|
||||
self.assertEqual(model.info["max_input_tokens"], 8 * 1024)
|
||||
|
||||
@patch('os.environ')
|
||||
@patch("os.environ")
|
||||
def test_sanity_check_model_all_set(self, mock_environ):
|
||||
mock_environ.get.return_value = "dummy_value"
|
||||
mock_io = MagicMock()
|
||||
|
@ -41,12 +41,14 @@ class TestModels(unittest.TestCase):
|
|||
|
||||
sanity_check_model(mock_io, model)
|
||||
|
||||
mock_io.tool_error.assert_called_once_with("Model test-model: Environment variables status:")
|
||||
mock_io.tool_error.assert_called_once_with(
|
||||
"Model test-model: Environment variables status:"
|
||||
)
|
||||
calls = mock_io.tool_error.call_args_list
|
||||
self.assertIn("- API_KEY1: ✓ Set", str(calls))
|
||||
self.assertIn("- API_KEY2: ✓ Set", str(calls))
|
||||
|
||||
@patch('os.environ')
|
||||
@patch("os.environ")
|
||||
def test_sanity_check_model_not_set(self, mock_environ):
|
||||
mock_environ.get.return_value = ""
|
||||
mock_io = MagicMock()
|
||||
|
@ -58,7 +60,9 @@ class TestModels(unittest.TestCase):
|
|||
|
||||
sanity_check_model(mock_io, model)
|
||||
|
||||
mock_io.tool_error.assert_called_once_with("Model test-model: Environment variables status:")
|
||||
mock_io.tool_error.assert_called_once_with(
|
||||
"Model test-model: Environment variables status:"
|
||||
)
|
||||
calls = mock_io.tool_error.call_args_list
|
||||
self.assertIn("- API_KEY1: ✗ Not set", str(calls))
|
||||
self.assertIn("- API_KEY2: ✗ Not set", str(calls))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue