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

Function test_empty_content

tests/test_content.py:13–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12@pytest.mark.anyio
13async def test_empty_content():
14 request = httpx.Request(method, url)
15 assert isinstance(request.stream, httpx.SyncByteStream)
16 assert isinstance(request.stream, httpx.AsyncByteStream)
17
18 sync_content = b"".join(list(request.stream))
19 async_content = b"".join([part async for part in request.stream])
20
21 assert request.headers == {"Host": "www.example.com", "Content-Length": "0"}
22 assert sync_content == b""
23 assert async_content == b""
24
25
26@pytest.mark.anyio

Callers

nothing calls this directly

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected