mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
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:
parent
a849093d89
commit
a57cdfddf8
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue