mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
test(mcp): mock draft cleanup for duplicate creation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
6996a1789c
commit
2597403f1f
1 changed files with 5 additions and 0 deletions
|
|
@ -238,6 +238,10 @@ async def test_create_duplicate_mcp_server():
|
|||
"litellm.proxy.management_endpoints.mcp_management_endpoints.get_mcp_server",
|
||||
new_callable=mock.AsyncMock,
|
||||
) as mock_get_server,
|
||||
mock.patch(
|
||||
"litellm.proxy.management_endpoints.mcp_management_endpoints._delete_draft_mcp_server",
|
||||
new_callable=mock.AsyncMock,
|
||||
) as mock_delete_draft,
|
||||
):
|
||||
# Import after mocking
|
||||
from litellm.proxy.management_endpoints.mcp_management_endpoints import (
|
||||
|
|
@ -282,6 +286,7 @@ async def test_create_duplicate_mcp_server():
|
|||
# Verify the exception details
|
||||
assert exc_info.value.status_code == 400
|
||||
assert "already exists" in str(exc_info.value.detail)
|
||||
mock_delete_draft.assert_awaited_once_with(mock_prisma, server_id)
|
||||
|
||||
|
||||
@_SKIP_NO_MCP
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue