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

Function test_async_streaming_response

tests/models/test_responses.py:701–714  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

699
700@pytest.mark.anyio
701async def test_async_streaming_response():
702 response = httpx.Response(
703 200,
704 content=async_streaming_body(),
705 )
706
707 assert response.status_code == 200
708 assert not response.is_closed
709
710 content = await response.aread()
711
712 assert content == b"Hello, world!"
713 assert response.content == b"Hello, world!"
714 assert response.is_closed
715
716
717def test_cannot_read_after_stream_consumed():

Callers

nothing calls this directly

Calls 2

areadMethod · 0.95
async_streaming_bodyFunction · 0.85

Tested by

no test coverage detected