Files
Marcelo Trylesinski 2713b53b12
CI / checks (push) Failing after 1s
CI / all-green (push) Has been cancelled
Replace httpx and httpx-sse with httpx2 (#2972)
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com>
2026-07-14 17:05:08 +01:00

25 lines
667 B
Python

"""Tests for httpx2 utility functions."""
import httpx2
from mcp.shared._httpx_utils import create_mcp_http_client
def test_default_settings():
"""Test that default settings are applied correctly."""
client = create_mcp_http_client()
assert client.follow_redirects is True
assert client.timeout.connect == 30.0
def test_custom_parameters():
"""Test custom headers and timeout are set correctly."""
headers = {"Authorization": "Bearer token"}
timeout = httpx2.Timeout(60.0)
client = create_mcp_http_client(headers, timeout)
assert client.headers["Authorization"] == "Bearer token"
assert client.timeout.connect == 60.0