aboutsummaryrefslogtreecommitdiffstats
path: root/test_llamachat.py
diff options
context:
space:
mode:
Diffstat (limited to 'test_llamachat.py')
-rwxr-xr-xtest_llamachat.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test_llamachat.py b/test_llamachat.py
index 6a5c0e6..09d6203 100755
--- a/test_llamachat.py
+++ b/test_llamachat.py
@@ -958,6 +958,26 @@ def test_provider_parsing():
# Unset numbers stay None so "unknown" is distinguishable from zero.
assert parsed["local"].ctx_size is None
assert parsed["local"].price_in is None
+
+ # A [providers.local] that omits base_url inherits the bare one rather
+ # than shadowing the local provider out of existence.
+ partial = providers.parse(
+ {
+ "base_url": "http://localhost:8181",
+ "providers": {"local": {"api_key": "env:SOME_VAR"}},
+ }
+ )
+ assert set(partial) == {"local"}
+ assert partial["local"].base_url == "http://localhost:8181"
+ # The explicit entry's own fields survive the merge.
+ assert partial["local"].api_key == "env:SOME_VAR"
+
+ # A filter given as a bare string is one needle, not four.
+ stringy = providers.parse(
+ {"providers": {"p": {"base_url": "http://x.example.org",
+ "filter": "qwen"}}}
+ )
+ assert stringy["p"].filter == ["qwen"]
print("ok provider config parsing")