test(guardrails): expect the content_filter finish on a blocked chat stream (#51281)

Co-authored-by: mateo <277851410+mateo-berri@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
devin-ai-integration[bot] 2026-11-12 00:57:46 +00:00 • committed by GitHub
parent 935a1b8cf6
commit 9c41214b0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1637,7 +1637,7 @@ def test_chat_pre_call_denial_streams_content_filter(gateway: Gateway, tmp_path:
assert lines[-1] == "data: [DONE]", response.text
chunks: Final = tuple(json.loads(line.removeprefix("data: ")) for line in lines[:-1])
assert chunks[0]["choices"][0]["delta"]["content"] == _RESPONSES_DENIAL, chunks
assert chunks[-1]["choices"][0]["finish_reason"] == "stop", chunks
assert chunks[-1]["choices"][0]["finish_reason"] == "content_filter", chunks
@pytest.mark.covers("other.observability.guardrails.chat_pre_call_denial_returns_content_filter")