mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
style: Fix whitespace and formatting in test file
This commit is contained in:
parent
a6cbaad5a2
commit
6933bc8add
1 changed files with 7 additions and 7 deletions
|
@ -1168,21 +1168,21 @@ class TestMain(TestCase):
|
||||||
test_file = Path(self.tempdir) / "test-model-metadata.json"
|
test_file = Path(self.tempdir) / "test-model-metadata.json"
|
||||||
test_resource_models = {
|
test_resource_models = {
|
||||||
"special-model": {
|
"special-model": {
|
||||||
"max_input_tokens": 8192,
|
"max_input_tokens": 8192,
|
||||||
"litellm_provider": "resource-provider",
|
"litellm_provider": "resource-provider",
|
||||||
"mode": "chat"
|
"mode": "chat",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
test_file.write_text(json.dumps(test_resource_models))
|
test_file.write_text(json.dumps(test_resource_models))
|
||||||
|
|
||||||
# Create a mock for the resource file path
|
# Create a mock for the resource file path
|
||||||
mock_resource_path = MagicMock()
|
mock_resource_path = MagicMock()
|
||||||
mock_resource_path.__str__.return_value = str(test_file)
|
mock_resource_path.__str__.return_value = str(test_file)
|
||||||
|
|
||||||
# Create a mock for the files function that returns an object with joinpath
|
# Create a mock for the files function that returns an object with joinpath
|
||||||
mock_files = MagicMock()
|
mock_files = MagicMock()
|
||||||
mock_files.joinpath.return_value = mock_resource_path
|
mock_files.joinpath.return_value = mock_resource_path
|
||||||
|
|
||||||
with patch("aider.main.importlib_resources.files", return_value=mock_files):
|
with patch("aider.main.importlib_resources.files", return_value=mock_files):
|
||||||
# Capture stdout to check the output
|
# Capture stdout to check the output
|
||||||
with patch("sys.stdout", new_callable=StringIO) as mock_stdout:
|
with patch("sys.stdout", new_callable=StringIO) as mock_stdout:
|
||||||
|
@ -1192,7 +1192,7 @@ class TestMain(TestCase):
|
||||||
output=DummyOutput(),
|
output=DummyOutput(),
|
||||||
)
|
)
|
||||||
output = mock_stdout.getvalue()
|
output = mock_stdout.getvalue()
|
||||||
|
|
||||||
# Check that the resource model appears in the output
|
# Check that the resource model appears in the output
|
||||||
self.assertIn("resource-provider/special-model", output)
|
self.assertIn("resource-provider/special-model", output)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue