MCPcopy Index your code
hub / github.com/python/cpython / test_readline_exception

Method test_readline_exception

Lib/test/test_asyncio/test_streams.py:367–377  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

365 self.assertEqual(b'ine3\n', stream._buffer)
366
367 def test_readline_exception(self):
368 stream = asyncio.StreamReader(loop=self.loop)
369 stream.feed_data(b'line\n')
370
371 data = self.loop.run_until_complete(stream.readline())
372 self.assertEqual(b'line\n', data)
373
374 stream.set_exception(ValueError())
375 self.assertRaises(
376 ValueError, self.loop.run_until_complete, stream.readline())
377 self.assertEqual(b'', stream._buffer)
378
379 def test_readuntil_separator(self):
380 stream = asyncio.StreamReader(loop=self.loop)

Callers

nothing calls this directly

Calls 6

feed_dataMethod · 0.95
readlineMethod · 0.95
set_exceptionMethod · 0.95
run_until_completeMethod · 0.45
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected