From 7cd96e9c2dc920977ffbc3ea149edf17f7e983b9 Mon Sep 17 00:00:00 2001 From: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com> Date: Sat, 19 Sep 2026 16:01:42 -0700 Subject: [PATCH] test(mcp): assert redirect rejection without SDK wording --- tests/test_litellm/experimental_mcp_client/test_mcp_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_litellm/experimental_mcp_client/test_mcp_client.py b/tests/test_litellm/experimental_mcp_client/test_mcp_client.py index 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: s if 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_operation assert responder.call_count == 1 request: 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)