()
| 11 | |
| 12 | @pytest.mark.anyio |
| 13 | async 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 |