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

Function test_build_request

tests/client/test_async_client.py:40–51  ·  tests/client/test_async_client.py::test_build_request
(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=class="st">"/echo_headers")
42 headers = {class="st">"Custom-header": class="st">"value"}
43 async with httpx.AsyncClient() as client:
44 request = client.build_request(class="st">"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()[class="st">"Custom-header"] == class="st">"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