test(mcp): mock draft cleanup in DB integration test

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

View file

@ -141,6 +141,10 @@ async def test_create_mcp_server_direct():
"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,
mock.patch(
"litellm.proxy.management_endpoints.mcp_management_endpoints.global_mcp_server_manager"
) as mock_manager,
@ -209,6 +213,7 @@ async def test_create_mcp_server_direct():
assert result.credentials is None
# Verify mocks were called
mock_delete_draft.assert_awaited_once_with(mock_prisma, server_id)
mock_get_server.assert_called_once_with(mock_prisma, server_id)
mock_create.assert_called_once()
mock_manager.add_server.assert_called_once_with(expected_response)