mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
test(router): cover _declared_param_allowlist malformed declarations
This commit is contained in:
parent
5338f293aa
commit
37e1bfecb1
1 changed files with 9 additions and 0 deletions
|
|
@ -11299,6 +11299,15 @@ class TestTierParamsTheTargetAccepts:
|
|||
|
||||
assert accepted == {"allowed_openai_params": ["seed"]}
|
||||
|
||||
def test_declared_param_allowlist_ignores_malformed_declarations(self):
|
||||
"""A str is iterable, so without the type guard a YAML scalar mistake like
|
||||
allowed_openai_params: reasoning_effort would allowlist single characters."""
|
||||
assert litellm.Router._declared_param_allowlist({"allowed_openai_params": ["reasoning_effort", 3]}) == frozenset(
|
||||
{"reasoning_effort"}
|
||||
)
|
||||
assert litellm.Router._declared_param_allowlist({"allowed_openai_params": "reasoning_effort"}) == frozenset()
|
||||
assert litellm.Router._declared_param_allowlist({}) == frozenset()
|
||||
|
||||
def test_deployment_accepts_param_honors_deployment_allowlist(self):
|
||||
deployment = {
|
||||
"model_name": "x",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue