mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 20:35:00 +00:00
feat: add test for --model-metadata-file option
This commit is contained in:
parent
e0bd9881ea
commit
ec836b99cc
1 changed files with 20 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import json
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
@ -489,3 +490,22 @@ class TestMain(TestCase):
|
||||||
self.assertIn(real_external_file_path, coder.abs_read_only_fnames)
|
self.assertIn(real_external_file_path, coder.abs_read_only_fnames)
|
||||||
finally:
|
finally:
|
||||||
os.unlink(external_file_path)
|
os.unlink(external_file_path)
|
||||||
|
|
||||||
|
def test_model_metadata_file(self):
|
||||||
|
with GitTemporaryDirectory():
|
||||||
|
metadata_file = Path(".aider.model.metadata.json")
|
||||||
|
metadata_content = {
|
||||||
|
"deepseek-chat": {
|
||||||
|
"max_input_tokens": 1234
|
||||||
|
}
|
||||||
|
}
|
||||||
|
metadata_file.write_text(json.dumps(metadata_content))
|
||||||
|
|
||||||
|
coder = main(
|
||||||
|
["--model", "deepseek-chat", "--model-metadata-file", str(metadata_file), "--exit", "--yes"],
|
||||||
|
input=DummyInput(),
|
||||||
|
output=DummyOutput(),
|
||||||
|
return_coder=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(coder.main_model.info["max_input_tokens"], 1234)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue