The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(mcp): assert redirect rejection without SDK wording
Joshua Valluru7cd96e9c2dc9
diff --git a/tests/test_litellm/experimental_mcp_client/test_mcp_client.py b/tests/test_litellm/experimental_mcp_client/test_mcp_client.pyindex 14ef5213d7a..7e4598c2e58 100644--- a/tests/test_litellm/experimental_mcp_client/test_mcp_client.py+++ b/tests/test_litellm/experimental_mcp_client/test_mcp_client.py@@ -1273,10 +1273,11 @@ async def test_sdk_cross_origin_redirect_never_contacts_destination(operation: sif operation == "list"else client.call_tool(CallToolRequestParams(name="add", arguments={"a": 2, "b": 3}), raise_on_error=True))- with anyio.fail_after(10), pytest.raises(MCPError, match=r"Redirect to .*destination.* not followed"):+ with anyio.fail_after(10), pytest.raises(MCPError):await pending_operationassert responder.call_count == 1request: Final = responder.call_args.args[0]+ assert request.method == "POST"assert request.url == "https://upstream.example.com/mcp"assert request.headers["x-upstream-token"] == "Bearer synthetic-token"assert all(call.args[0].url.host != "destination.example.com" for call in responder.call_args_list)