From 4752dfa6f7e658cd6066cebb4cd76d211bf8e17e Mon Sep 17 00:00:00 2001 From: scthornton Date: Mon, 31 Aug 2026 14:50:55 -0400 Subject: [PATCH] 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 --- .../guardrails/guardrail_hooks/test_panw_prisma_airs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_panw_prisma_airs.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_panw_prisma_airs.py index 87ddb46638d..598b363c0fe 100644 --- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_panw_prisma_airs.py +++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_panw_prisma_airs.py @@ -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