MCPcopy Index your code
hub / github.com/encode/httpx / test_build_request

Function test_build_request

tests/client/test_async_client.py:40–51  ·  view source on GitHub ↗
(server)

Source from the content-addressed store, hash-verified

38
39@pytest.mark.anyio
40async def test_build_request(server):
41 url = server.url.copy_with(path="/echo_headers")
42 headers = {"Custom-header": "value"}
43 async with httpx.AsyncClient() as client:
44 request = client.build_request("GET", url)
45 request.headers.update(headers)
46 response = await client.send(request)
47
48 assert response.status_code == 200
49 assert response.url == url
50
51 assert response.json()["Custom-header"] == "value"
52
53
54@pytest.mark.anyio

Callers

nothing calls this directly

Calls 5

build_requestMethod · 0.80
jsonMethod · 0.80
copy_withMethod · 0.45
updateMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected