mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
test(panw_prisma_airs): assert returned texts so scope tests observe caller-visible behavior
Clears the two TQ002 (mock-echo) findings the test-quality budget gate flagged: both tests now assert the texts apply_guardrail returns in addition to the scan-call expectations. Claude-Session: https://claude.ai/code/session_019e3TmBntsNQTBbXB9iu9uZ
This commit is contained in:
parent
6ff0f4a03c
commit
4752dfa6f7
1 changed files with 6 additions and 2 deletions
|
|
@ -5121,12 +5121,14 @@ class TestPanwAirsLatestRoleMessageOnlyOpenAIShape:
|
|||
) as mock_api:
|
||||
mock_api.return_value = {"action": "allow", "category": "benign"}
|
||||
|
||||
await handler.apply_guardrail(
|
||||
result = await handler.apply_guardrail(
|
||||
inputs=inputs,
|
||||
request_data=request_data,
|
||||
input_type="request",
|
||||
)
|
||||
|
||||
# All texts pass through unmodified on allow
|
||||
assert result["texts"] == ["system text", "assistant text"]
|
||||
# Fallback role-filter scan: system scanned, assistant skipped
|
||||
assert mock_api.call_count == 1
|
||||
assert mock_api.call_args.kwargs["content"] == "system text"
|
||||
|
|
@ -5229,12 +5231,14 @@ class TestPanwAirsLatestRoleMessageOnlyOpenAIShape:
|
|||
) as mock_api:
|
||||
mock_api.return_value = {"action": "allow", "category": "benign"}
|
||||
|
||||
await handler.apply_guardrail(
|
||||
result = await handler.apply_guardrail(
|
||||
inputs=inputs,
|
||||
request_data=openai_multiturn_request_data,
|
||||
input_type="response",
|
||||
)
|
||||
|
||||
# All texts pass through unmodified on allow
|
||||
assert result["texts"] == ["response text one", "response text two"]
|
||||
# Both response texts scanned; scope filtering is request-side only
|
||||
assert mock_api.call_count == 2
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue