test(mcp): mock draft cleanup for duplicate creation
Some checks failed
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
mateo 2026-07-10 04:52:07 +00:00
parent 6996a1789c
commit 2597403f1f

View file

@ -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