()
| 350 | |
| 351 | @pytest.mark.anyio |
| 352 | async def test_aread(): |
| 353 | response = httpx.Response( |
| 354 | 200, |
| 355 | content=b"Hello, world!", |
| 356 | ) |
| 357 | |
| 358 | assert response.status_code == 200 |
| 359 | assert response.text == "Hello, world!" |
| 360 | assert response.encoding == "utf-8" |
| 361 | assert response.is_closed |
| 362 | |
| 363 | content = await response.aread() |
| 364 | |
| 365 | assert content == b"Hello, world!" |
| 366 | assert response.content == b"Hello, world!" |
| 367 | assert response.is_closed |
| 368 | |
| 369 | |
| 370 | @pytest.mark.anyio |