mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
fix(mcp): align gateway fixtures and migration with CI contracts
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
b6679a2a81
commit
d42ed1e5ce
5 changed files with 9 additions and 0 deletions
|
|
@ -1,3 +1,5 @@
|
|||
SET LOCAL lock_timeout = '10s';
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
CREATE TYPE "MCPExecutionMode" AS ENUM ('litellm', 'provider');
|
||||
|
|
|
|||
|
|
@ -486,6 +486,7 @@ def map_algorithm(request: pytest.FixtureRequest, monkeypatch: pytest.MonkeyPatc
|
|||
|
||||
def _prisma_map_row(data: dict[str, object], quoted: bool = False) -> PrismaMCPServer:
|
||||
return PrismaMCPServer.model_validate({
|
||||
"execution_mode": "litellm",
|
||||
"transport": "http", "mcp_access_groups": [], "allowed_tools": [], "extra_headers": [], "args": [],
|
||||
"allow_all_keys": False, "available_on_public_internet": True, "delegate_auth_to_upstream": False,
|
||||
"oauth_passthrough": False, "per_server_oauth_discovery": False, "is_byok": False, "byok_description": [],
|
||||
|
|
|
|||
|
|
@ -1551,6 +1551,7 @@ async def test_create_mcp_server_decrypts_env_vars_when_prisma_returns_json_stri
|
|||
from prisma.models import LiteLLM_MCPServerTable
|
||||
|
||||
return LiteLLM_MCPServerTable.model_validate({
|
||||
"execution_mode": "litellm",
|
||||
"server_id": "srv-returned", "transport": "http", "mcp_access_groups": [], "allowed_tools": [],
|
||||
"extra_headers": [], "args": [], "allow_all_keys": False, "available_on_public_internet": True,
|
||||
"delegate_auth_to_upstream": False, "oauth_passthrough": False, "per_server_oauth_discovery": False,
|
||||
|
|
|
|||
|
|
@ -1560,6 +1560,7 @@ async def test_add_update_server_with_alias():
|
|||
|
||||
# Create a mock LiteLLM_MCPServerTable with alias
|
||||
mock_mcp_server = MagicMock()
|
||||
mock_mcp_server.execution_mode = "litellm"
|
||||
mock_mcp_server.server_id = "test-server-123"
|
||||
mock_mcp_server.alias = "my_alias"
|
||||
mock_mcp_server.server_name = "Test Server"
|
||||
|
|
@ -1624,6 +1625,7 @@ async def test_add_update_server_without_alias():
|
|||
|
||||
# Create a mock LiteLLM_MCPServerTable without alias
|
||||
mock_mcp_server = MagicMock()
|
||||
mock_mcp_server.execution_mode = "litellm"
|
||||
mock_mcp_server.server_id = "test-server-123"
|
||||
mock_mcp_server.alias = None
|
||||
mock_mcp_server.server_name = "Test Server"
|
||||
|
|
@ -1688,6 +1690,7 @@ async def test_add_update_server_fallback_to_server_id():
|
|||
|
||||
# Create a mock LiteLLM_MCPServerTable without alias or server_name
|
||||
mock_mcp_server = MagicMock()
|
||||
mock_mcp_server.execution_mode = "litellm"
|
||||
mock_mcp_server.server_id = "test-server-123"
|
||||
mock_mcp_server.alias = None
|
||||
mock_mcp_server.server_name = None
|
||||
|
|
|
|||
|
|
@ -829,6 +829,7 @@ class TestSigV4BuildFromTable:
|
|||
|
||||
table_record = MagicMock()
|
||||
table_record.server_id = "test-sigv4-server"
|
||||
table_record.execution_mode = "litellm"
|
||||
table_record.server_name = "sigv4_server"
|
||||
table_record.alias = None
|
||||
table_record.description = None
|
||||
|
|
@ -899,6 +900,7 @@ class TestSigV4BuildFromTable:
|
|||
|
||||
table_record = MagicMock()
|
||||
table_record.server_id = "test-bearer-server"
|
||||
table_record.execution_mode = "litellm"
|
||||
table_record.server_name = "bearer_server"
|
||||
table_record.alias = None
|
||||
table_record.description = None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue