MCPcopy
hub / github.com/aio-libs/aiohttp / test_readexactly_exception

Method test_readexactly_exception

tests/test_streams.py:363–372  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

361 self.assertEqual(b'', data)
362
363 def test_readexactly_exception(self):
364 stream = self._make_one()
365 stream.feed_data(b'line\n')
366
367 data = self.loop.run_until_complete(stream.readexactly(2))
368 self.assertEqual(b'li', data)
369
370 stream.set_exception(ValueError())
371 self.assertRaises(
372 ValueError, self.loop.run_until_complete, stream.readexactly(2))
373
374 def test_unread_data(self):
375 stream = self._make_one()

Callers

nothing calls this directly

Calls 4

_make_oneMethod · 0.95
feed_dataMethod · 0.45
readexactlyMethod · 0.45
set_exceptionMethod · 0.45

Tested by

no test coverage detected