(self)
| 323 | |
| 324 | class TestStreamRequest: |
| 325 | def test_read(self) -> None: |
| 326 | with impit.stream('GET', get_httpbin_url('/')) as response: |
| 327 | assert response.status_code == 200 |
| 328 | assert response.is_closed is False |
| 329 | assert response.is_stream_consumed is False |
| 330 | |
| 331 | content = response.read() |
| 332 | |
| 333 | assert isinstance(content, bytes) |
| 334 | assert content.decode('utf-8') == response.text |
| 335 | assert response.content == content |
| 336 | |
| 337 | assert response.is_closed is True |
| 338 | assert response.is_stream_consumed is True # type: ignore[unreachable] # Mypy can't detect a change of state |
| 339 | |
| 340 | def test_iter_bytes(self) -> None: |
| 341 | with impit.stream('GET', get_httpbin_url('/')) as response: |
nothing calls this directly
no test coverage detected