MCPcopy
hub / github.com/encode/httpx / test_asgi_headers

Function test_asgi_headers

tests/test_asgi.py:150–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148
149@pytest.mark.anyio
150async def test_asgi_headers():
151 transport = httpx.ASGITransport(app=echo_headers)
152 async with httpx.AsyncClient(transport=transport) as client:
153 response = await client.get("http://www.example.org/")
154
155 assert response.status_code == 200
156 assert response.json() == {
157 "headers": [
158 ["host", "www.example.org"],
159 ["accept", "*/*"],
160 ["accept-encoding", "gzip, deflate, br, zstd"],
161 ["connection", "keep-alive"],
162 ["user-agent", f"python-httpx/{httpx.__version__}"],
163 ]
164 }
165
166
167@pytest.mark.anyio

Callers

nothing calls this directly

Calls 2

jsonMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected