Skip to content

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]

test(proxy): expect the sanitized unknown-model message in the spend-log error test

mateo-berri3dafa7aac10f
diff --git a/tests/store_model_in_db_tests/test_openai_error_handling.py b/tests/store_model_in_db_tests/test_openai_error_handling.py
index 5de7c427d19..22707d522bc 100644
--- a/tests/store_model_in_db_tests/test_openai_error_handling.py
+++ b/tests/store_model_in_db_tests/test_openai_error_handling.py
@@ -210,7 +210,8 @@ async def test_chat_completion_bad_model_with_spend_logs():
assert "traceback" in error_info
assert error_info["error_code"] == "400"
assert error_info["error_class"] in ("ProxyModelNotFoundError", "BadRequestError")
- assert "non-existent-model" in error_info["error_message"]
+ assert "non-existent-model" not in error_info["error_message"]
+ assert "/chat/completions: Invalid model name passed in" in error_info["error_message"]
# Verify request details
assert log_entry["cache_hit"] == "False"