mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
test(mcp): awaitable catalog revision doubles in prisma mocks
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
1453a13369
commit
7aea330dfd
3 changed files with 4 additions and 0 deletions
|
|
@ -219,6 +219,7 @@ async def test_guardrail_observes_saved_server_creation_and_deletion_on_another_
|
|||
url="https://upstream.example/mcp")
|
||||
prisma = MagicMock()
|
||||
prisma.db.litellm_mcpservertable.find_many = AsyncMock(side_effect=([row], []))
|
||||
prisma.db.litellm_config.find_unique = AsyncMock(return_value=None)
|
||||
data = {"tools": [{"type": "mcp", "server_url": "litellm_proxy/mcp/peer-server"}],
|
||||
"guardrails": ["test-mcp-security"]}
|
||||
with (
|
||||
|
|
|
|||
|
|
@ -2775,6 +2775,7 @@ class TestTemporaryMCPSessionEndpoints:
|
|||
prisma.db.litellm_mcpservertable.find_many = AsyncMock(side_effect=persisted_rows)
|
||||
prisma.db.litellm_mcpservertable.find_unique = AsyncMock(return_value=None)
|
||||
prisma.db.litellm_mcpservertable.find_first = AsyncMock(return_value=None)
|
||||
prisma.db.litellm_config.find_unique = AsyncMock(return_value=None)
|
||||
request: Final = Request(
|
||||
{"type": "http", "method": "GET", "scheme": "http", "server": ("localhost", 4000),
|
||||
"path": "/v1/mcp/server/oauth/saved-server/authorize", "headers": [],
|
||||
|
|
@ -8016,6 +8017,7 @@ async def test_saved_server_authorize_denial_does_not_dispatch_upstream():
|
|||
authorization_url="https://upstream.example/authorize", token_url="https://upstream.example/token")
|
||||
prisma: Final = MagicMock()
|
||||
prisma.db.litellm_mcpservertable.find_many = AsyncMock(return_value=[row])
|
||||
prisma.db.litellm_config.find_unique = AsyncMock(return_value=None)
|
||||
user: Final = generate_mock_user_api_key_auth(user_role=LitellmUserRoles.INTERNAL_USER)
|
||||
with (
|
||||
patch("litellm.proxy.proxy_server.prisma_client", prisma),
|
||||
|
|
|
|||
|
|
@ -644,6 +644,7 @@ async def test_dynamic_route_observes_committed_peer_catalog_changes(monkeypatch
|
|||
prisma = SimpleNamespace(db=SimpleNamespace(
|
||||
litellm_mcpservertable=SimpleNamespace(find_many=read_rows),
|
||||
litellm_mcptoolsettable=SimpleNamespace(find_first=AsyncMock(return_value=None)),
|
||||
litellm_config=SimpleNamespace(find_unique=AsyncMock(return_value=None)),
|
||||
))
|
||||
manager = mcp_server_manager.MCPServerManager()
|
||||
if change != "create":
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue