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

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
devin-ai-integration[bot] 2026-10-03 18:31:48 +00:00 • committed by GitHub
parent a849093d89
commit a57cdfddf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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