mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
test(bedrock): update normalize_checks test to keep empty known checks
This commit is contained in:
parent
1a889ffa38
commit
1278012a91
1 changed files with 6 additions and 3 deletions
|
|
@ -63,11 +63,14 @@ def test_init_normalizes_checks_and_drops_unknown_keys():
|
|||
g = BedrockGuardrail(
|
||||
checks={
|
||||
"contentFilter": {"categories": [{"category": "VIOLENCE"}]},
|
||||
"unknownCheck": {"foo": "bar"},
|
||||
"promptAttack": {}, # empty -> dropped
|
||||
"unknownCheck": {"foo": "bar"}, # unknown key -> dropped
|
||||
"promptAttack": {}, # empty known check -> kept (enable with defaults)
|
||||
}
|
||||
)
|
||||
assert g.checks == {"contentFilter": {"categories": [{"category": "VIOLENCE"}]}}
|
||||
assert g.checks == {
|
||||
"contentFilter": {"categories": [{"category": "VIOLENCE"}]},
|
||||
"promptAttack": {},
|
||||
}
|
||||
|
||||
|
||||
def test_init_empty_checks_falls_back_to_apply_mode():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue