MCPcopy Create free account
hub / github.com/apify/impit / test_read_after_close

Method test_read_after_close

impit-python/test/async_client_test.py:601–610  ·  view source on GitHub ↗
(self, browser: Browser)

Source from the content-addressed store, hash-verified

599 assert response.is_stream_consumed is False # type: ignore[unreachable] # Mypy can't detect a change of state
600
601 async def test_read_after_close(self, browser: Browser) -> None:
602 impit = AsyncClient(browser=browser)
603
604 async with impit.stream('GET', get_httpbin_url('/')) as response:
605 assert response.status_code == 200
606
607 assert response.is_closed is True
608
609 with pytest.raises(StreamClosed):
610 response.read()
611
612 async def test_two_read_calls(self, browser: Browser) -> None:
613 impit = AsyncClient(browser=browser)

Callers

nothing calls this directly

Calls 4

streamMethod · 0.95
AsyncClientClass · 0.90
get_httpbin_urlFunction · 0.85
readMethod · 0.80

Tested by

no test coverage detected