test(mcp): patch create_mcp_server_if_identifier_free in the store-model-in-db MCP tests (#42916)

#42791 switched the MCP management endpoints from create_mcp_server to
create_mcp_server_if_identifier_free, which keeps the same arguments and
returns the created row on success. Two tests in
tests/store_model_in_db_tests/test_mcp_servers.py still patched the old name,
so mock.patch raised AttributeError before the tests ran and
proxy_store_model_in_db_tests has been red on main since.
This commit is contained in:
yuneng-jiang 2026-09-24 11:59:52 -07:00 • committed by GitHub
parent 2cbaa4c9b5
commit 4c68a97c25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -134,7 +134,7 @@ async def test_create_mcp_server_direct():
"litellm.proxy.management_endpoints.mcp_management_endpoints.get_prisma_client_or_throw"
) as mock_get_prisma,
mock.patch(
"litellm.proxy.management_endpoints.mcp_management_endpoints.create_mcp_server",
"litellm.proxy.management_endpoints.mcp_management_endpoints.create_mcp_server_if_identifier_free",
new_callable=mock.AsyncMock,
) as mock_create,
mock.patch(
@ -345,7 +345,7 @@ async def test_create_mcp_server_invalid_alias():
"litellm.proxy.management_endpoints.mcp_management_endpoints.get_mcp_server"
) as mock_get_server,
mock.patch(
"litellm.proxy.management_endpoints.mcp_management_endpoints.create_mcp_server"
"litellm.proxy.management_endpoints.mcp_management_endpoints.create_mcp_server_if_identifier_free"
) as mock_create,
):
from litellm.proxy.management_endpoints.mcp_management_endpoints import (