mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
style: Format test data with consistent indentation
This commit is contained in:
parent
2331224157
commit
6acbd80cee
1 changed files with 17 additions and 4 deletions
|
@ -1068,8 +1068,14 @@ class TestMain(TestCase):
|
||||||
# Create a temporary model-metadata.json with test models
|
# Create a temporary model-metadata.json with test models
|
||||||
metadata_file = Path(".aider.model.metadata.json")
|
metadata_file = Path(".aider.model.metadata.json")
|
||||||
test_models = {
|
test_models = {
|
||||||
"unique-model-name": {"max_input_tokens": 8192, "litellm_provider": "test-provider"},
|
"unique-model-name": {
|
||||||
"another-unique-model": {"max_input_tokens": 4096, "litellm_provider": "another-provider"},
|
"max_input_tokens": 8192,
|
||||||
|
"litellm_provider": "test-provider",
|
||||||
|
},
|
||||||
|
"another-unique-model": {
|
||||||
|
"max_input_tokens": 4096,
|
||||||
|
"litellm_provider": "another-provider",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
metadata_file.write_text(json.dumps(test_models))
|
metadata_file.write_text(json.dumps(test_models))
|
||||||
|
|
||||||
|
@ -1097,7 +1103,12 @@ class TestMain(TestCase):
|
||||||
with GitTemporaryDirectory():
|
with GitTemporaryDirectory():
|
||||||
# Create a temporary model-metadata.json with test models
|
# Create a temporary model-metadata.json with test models
|
||||||
metadata_file = Path(".aider.model.metadata.json")
|
metadata_file = Path(".aider.model.metadata.json")
|
||||||
test_models = {"metadata-only-model": {"max_input_tokens": 8192, "litellm_provider": "test-provider"}}
|
test_models = {
|
||||||
|
"metadata-only-model": {
|
||||||
|
"max_input_tokens": 8192,
|
||||||
|
"litellm_provider": "test-provider",
|
||||||
|
}
|
||||||
|
}
|
||||||
metadata_file.write_text(json.dumps(test_models))
|
metadata_file.write_text(json.dumps(test_models))
|
||||||
|
|
||||||
# Patch litellm.model_cost to include a test model
|
# Patch litellm.model_cost to include a test model
|
||||||
|
@ -1150,7 +1161,9 @@ class TestMain(TestCase):
|
||||||
# Test that models from resources/model-metadata.json are included in list-models output
|
# Test that models from resources/model-metadata.json are included in list-models output
|
||||||
with GitTemporaryDirectory():
|
with GitTemporaryDirectory():
|
||||||
# Mock the importlib.resources.open_text to return a custom model-metadata.json
|
# Mock the importlib.resources.open_text to return a custom model-metadata.json
|
||||||
test_resource_models = {"special-model": {"max_input_tokens": 8192, "litellm_provider": "resource-provider"}}
|
test_resource_models = {
|
||||||
|
"special-model": {"max_input_tokens": 8192, "litellm_provider": "resource-provider"}
|
||||||
|
}
|
||||||
|
|
||||||
mock_file = MagicMock()
|
mock_file = MagicMock()
|
||||||
mock_file.read.return_value = json.dumps(test_resource_models)
|
mock_file.read.return_value = json.dumps(test_resource_models)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue