mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
fix(tests): add spec_path=None to MCP server mocks to fix Pydantic validation
spec_path was added to LiteLLM_MCPServerTable but the three test_add_update_server_* mocks weren't updated. MagicMock auto-creates a MagicMock for unset attributes, which fails the Optional[str] Pydantic validation. Fixes test_add_update_server_with_alias, test_add_update_server_without_alias and test_add_update_server_fallback_to_server_id. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6af3d073f0
commit
375f79de03
1 changed files with 3 additions and 0 deletions
|
|
@ -1430,6 +1430,7 @@ async def test_add_update_server_with_alias():
|
|||
mock_mcp_server.command = None
|
||||
mock_mcp_server.args = []
|
||||
mock_mcp_server.env = None
|
||||
mock_mcp_server.spec_path = None
|
||||
# OAuth fields - set explicitly to None to avoid MagicMock objects
|
||||
mock_mcp_server.client_id = None
|
||||
mock_mcp_server.client_secret = None
|
||||
|
|
@ -1470,6 +1471,7 @@ async def test_add_update_server_without_alias():
|
|||
mock_mcp_server.command = None
|
||||
mock_mcp_server.args = []
|
||||
mock_mcp_server.env = None
|
||||
mock_mcp_server.spec_path = None
|
||||
# OAuth fields - set explicitly to None to avoid MagicMock objects
|
||||
mock_mcp_server.client_id = None
|
||||
mock_mcp_server.client_secret = None
|
||||
|
|
@ -1510,6 +1512,7 @@ async def test_add_update_server_fallback_to_server_id():
|
|||
mock_mcp_server.command = None
|
||||
mock_mcp_server.args = []
|
||||
mock_mcp_server.env = None
|
||||
mock_mcp_server.spec_path = None
|
||||
# OAuth fields - set explicitly to None to avoid MagicMock objects
|
||||
mock_mcp_server.client_id = None
|
||||
mock_mcp_server.client_secret = None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue