mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-24 05:45:11 +00:00
test(proxy): annotate the content_policy_fallbacks config update test locals as Final
This commit is contained in:
parent
9c88a086a6
commit
5f9aa12b71
1 changed files with 7 additions and 4 deletions
|
|
@ -10118,12 +10118,15 @@ def test_update_config_accepts_disjoint_routing_groups(_update_config_setup):
|
|||
def test_update_config_validates_content_policy_fallbacks_like_fallbacks(_update_config_setup):
|
||||
client, prisma, restore = _update_config_setup(initial_rows={"router_settings": {"num_retries": 2}})
|
||||
rule: Final = [{"gpt-5.4-mini": ["gpt-5.4-nano"]}]
|
||||
malformed: Final = ("oops", 5, [1, 2], [{"gpt-5.4-mini": "gpt-5.4-nano"}], [{"gpt-5.4-mini": ["gpt-5.4-nano", 7]}])
|
||||
try:
|
||||
for malformed in ("oops", 5, [1, 2], [{"gpt-5.4-mini": "gpt-5.4-nano"}], [{"gpt-5.4-mini": ["gpt-5.4-nano", 7]}]):
|
||||
rejected = client.post("/config/update", json={"router_settings": {"content_policy_fallbacks": malformed}})
|
||||
assert rejected.status_code == 422, malformed
|
||||
rejected: Final = tuple(
|
||||
client.post("/config/update", json={"router_settings": {"content_policy_fallbacks": value}}).status_code
|
||||
for value in malformed
|
||||
)
|
||||
assert rejected == (422,) * len(malformed)
|
||||
assert prisma.db.litellm_config.rows["router_settings"] == {"num_retries": 2}
|
||||
accepted = client.post("/config/update", json={"router_settings": {"content_policy_fallbacks": rule}})
|
||||
accepted: Final = client.post("/config/update", json={"router_settings": {"content_policy_fallbacks": rule}})
|
||||
assert accepted.status_code == 200
|
||||
assert prisma.db.litellm_config.rows["router_settings"] == {"num_retries": 2, "content_policy_fallbacks": rule}
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue