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

Method test_read_limit

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

Source from the content-addressed store, hash-verified

214 asyncio.StreamReader(limit=-1, loop=self.loop)
215
216 def test_read_limit(self):
217 stream = asyncio.StreamReader(limit=3, loop=self.loop)
218 stream.feed_data(b'chunk')
219 data = self.loop.run_until_complete(stream.read(5))
220 self.assertEqual(b'chunk', data)
221 self.assertEqual(b'', stream._buffer)
222
223 def test_readline(self):
224 # Read one line. 'readline' will need to wait for the data

Callers

nothing calls this directly

Calls 4

feed_dataMethod · 0.95
readMethod · 0.95
run_until_completeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected