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(e2e): validate the captured /model/new body with its pydantic model

Yuneng Jiang185a712d2409
diff --git a/tests/e2e/test_proxy_client.py b/tests/e2e/test_proxy_client.py
index fc13e701fc9..37f56cdc2d4 100644
--- a/tests/e2e/test_proxy_client.py
+++ b/tests/e2e/test_proxy_client.py
@@ -40,6 +40,7 @@ from models import (
KeyInfoResponse,
KeyUpdateBody,
LiteLLMParamsBody,
+ ModelNewBody,
McpServerCreateBody,
McpServerUpdateBody,
ModelListEntry,
@@ -609,9 +610,10 @@ def test_registration_binds_the_deployment_to_this_test_unless_it_is_provider_li
)
finally:
configured_cache.cache_clear()
- params: Final = json.loads(bodies.get_nowait())["litellm_params"]
+ sent: Final = ModelNewBody.model_validate_json(bodies.get_nowait())
assert bodies.empty()
if provider_live:
- assert params.get("api_base") is None
+ assert sent.litellm_params.api_base is None
return
- assert params["api_base"].endswith(f"/openai/t/{slug_for_test(current_test_key())}/v1")
+ assert sent.litellm_params.api_base is not None
+ assert sent.litellm_params.api_base.endswith(f"/openai/t/{slug_for_test(current_test_key())}/v1")