MCPcopy Create free account
hub / github.com/python/cpython / test_readexactly_limit

Method test_readexactly_limit

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

Source from the content-addressed store, hash-verified

547 self.assertEqual(self.DATA, stream._buffer)
548
549 def test_readexactly_limit(self):
550 stream = asyncio.StreamReader(limit=3, loop=self.loop)
551 stream.feed_data(b'chunk')
552 data = self.loop.run_until_complete(stream.readexactly(5))
553 self.assertEqual(b'chunk', data)
554 self.assertEqual(b'', stream._buffer)
555
556 def test_readexactly_eof(self):
557 # Read exact number of bytes (eof).

Callers

nothing calls this directly

Calls 4

feed_dataMethod · 0.95
readexactlyMethod · 0.95
run_until_completeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected