From 2597403f1ff7b7a299cde468058137786423fdcc Mon Sep 17 00:00:00 2001 From: mateo Date: Fri, 10 Jul 2026 04:52:07 +0000 Subject: [PATCH] test(mcp): mock draft cleanup for duplicate creation Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/store_model_in_db_tests/test_mcp_servers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/store_model_in_db_tests/test_mcp_servers.py b/tests/store_model_in_db_tests/test_mcp_servers.py index 87e87142a42..ea916bcdd30 100644 --- a/tests/store_model_in_db_tests/test_mcp_servers.py +++ b/tests/store_model_in_db_tests/test_mcp_servers.py @@ -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