The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(proxy): set status_code on chunk_processor response mocks
Shivam Rawatcbfba17b1c89
diff --git a/tests/pass_through_unit_tests/test_unit_test_streaming.py b/tests/pass_through_unit_tests/test_unit_test_streaming.pyindex 63965320f2b..ed98b720b37 100644--- a/tests/pass_through_unit_tests/test_unit_test_streaming.py+++ b/tests/pass_through_unit_tests/test_unit_test_streaming.py@@ -50,6 +50,7 @@ async def test_chunk_processor_yields_raw_bytes(endpoint_type, url_route):"""# Mock inputsresponse = AsyncMock(spec=httpx.Response)+ response.status_code = 200raw_chunks = [b'{"id": "1", "content": "Hello"}',b'{"id": "2", "content": "World"}',diff --git a/tests/pass_through_unit_tests/test_vertex_ai_anthropic_streaming_cost_injection.py b/tests/pass_through_unit_tests/test_vertex_ai_anthropic_streaming_cost_injection.pyindex 3e94eb3a4f5..b42f1fe6f0a 100644--- a/tests/pass_through_unit_tests/test_vertex_ai_anthropic_streaming_cost_injection.py+++ b/tests/pass_through_unit_tests/test_vertex_ai_anthropic_streaming_cost_injection.py@@ -39,6 +39,7 @@ async def test_vertex_ai_anthropic_streaming_cost_injection_enabled():try:# Mock response with Anthropic SSE format chunksresponse = AsyncMock(spec=httpx.Response)+ response.status_code = 200# Create chunks with message_delta event containing usagechunks_with_usage = [@@ -120,6 +121,7 @@ async def test_vertex_ai_anthropic_streaming_cost_injection_disabled():try:# Mock response with Anthropic SSE format chunksresponse = AsyncMock(spec=httpx.Response)+ response.status_code = 200chunks_with_usage = [b'data: {"type": "message_delta", "usage": {"input_tokens": 10, "output_tokens": 5}}\n\n',@@ -178,6 +180,7 @@ async def test_vertex_ai_anthropic_streaming_cost_injection_no_usage_chunk():try:response = AsyncMock(spec=httpx.Response)+ response.status_code = 200# Chunks without usage (should not be modified)chunks_without_usage = [@@ -233,6 +236,7 @@ async def test_vertex_ai_anthropic_streaming_model_extraction():try:response = AsyncMock(spec=httpx.Response)+ response.status_code = 200chunks = [b'data: {"type": "message_delta", "usage": {"input_tokens": 10, "output_tokens": 5}}\n\n',