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]

fix(ci): give the pass-through auth regression test a real FastAPI app (#44403)

devin-ai-integration[bot]a57cdfddf803
diff --git a/tests/unit/proxy/pass_through_endpoints/test_passthrough_auth_default.py b/tests/unit/proxy/pass_through_endpoints/test_passthrough_auth_default.py
index 44a75c362e5..676934ba3e0 100644
--- a/tests/unit/proxy/pass_through_endpoints/test_passthrough_auth_default.py
+++ b/tests/unit/proxy/pass_through_endpoints/test_passthrough_auth_default.py
@@ -23,6 +23,7 @@ from unittest.mock import AsyncMock, MagicMock
import pytest
from fastapi import FastAPI
+from fastapi.routing import APIRoute
from litellm.proxy._types import PassThroughGenericEndpoint
@@ -61,7 +62,7 @@ async def test_register_passthrough_with_auth_true_works_for_oss(monkeypatch):
# Regression: setting ``auth: true`` used to raise at startup
# unless ``premium_user`` was True, leaving OSS with no safe
# configuration.
- app = MagicMock(spec=FastAPI)
+ app = FastAPI()
visited: set = set()
endpoint = PassThroughGenericEndpoint(
@@ -77,6 +78,7 @@ async def test_register_passthrough_with_auth_true_works_for_oss(monkeypatch):
premium_user=False,
visited_endpoints=visited,
)
+ assert [route.path for route in app.routes if isinstance(route, APIRoute)] == ["/forwarder"]
@pytest.mark.asyncio