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: handle wildcard routes in route validation test

Yuta Saito3a55f68ea422
diff --git a/tests/proxy_unit_tests/test_proxy_routes.py b/tests/proxy_unit_tests/test_proxy_routes.py
index c2dc0542f17..6d704a6267e 100644
--- a/tests/proxy_unit_tests/test_proxy_routes.py
+++ b/tests/proxy_unit_tests/test_proxy_routes.py
@@ -56,6 +56,12 @@ def test_routes_on_litellm_proxy():
# realtime routes - /realtime?model=gpt-4o
if "realtime" in route:
assert "/realtime" in _all_routes
+ # wildcard patterns like /containers/* - check that base path exists
+ elif RouteChecks._is_wildcard_pattern(pattern=route):
+ # For wildcard patterns, check that the base path (without * and trailing /) exists
+ base_path = route[:-1].rstrip("/") # Remove the trailing * and any trailing /
+ # Check if base path exists (e.g., /containers or /v1/containers)
+ assert base_path in _all_routes, f"Wildcard pattern {route} requires base path {base_path} to exist"
else:
assert route in _all_routes