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

Method test_readuntil_eof

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

Source from the content-addressed store, hash-verified

439 self.assertEqual(b'', stream._buffer)
440
441 def test_readuntil_eof(self):
442 stream = asyncio.StreamReader(loop=self.loop)
443 data = b'some dataAA'
444 stream.feed_data(data)
445 stream.feed_eof()
446
447 with self.assertRaisesRegex(asyncio.IncompleteReadError,
448 'undefined expected bytes') as cm:
449 self.loop.run_until_complete(stream.readuntil(b'AAA'))
450 self.assertEqual(cm.exception.partial, data)
451 self.assertIsNone(cm.exception.expected)
452 self.assertEqual(b'', stream._buffer)
453
454 def test_readuntil_limit_found_sep(self):
455 stream = asyncio.StreamReader(loop=self.loop, limit=3)

Callers

nothing calls this directly

Calls 7

feed_dataMethod · 0.95
feed_eofMethod · 0.95
readuntilMethod · 0.95
assertRaisesRegexMethod · 0.80
assertIsNoneMethod · 0.80
run_until_completeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected