Merge pull request #19182 from BerriAI/litellm_fix_ci_test_proxy_routes

[test] handle wildcard routes in route validation test
This commit is contained in:
YutaSaito 2026-01-16 13:07:00 +09:00 committed by GitHub
commit 18de9d71af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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