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

Method test_read_zero

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

Source from the content-addressed store, hash-verified

134 self.assertEqual(self.DATA, stream._buffer)
135
136 def test_read_zero(self):
137 # Read zero bytes.
138 stream = asyncio.StreamReader(loop=self.loop)
139 stream.feed_data(self.DATA)
140
141 data = self.loop.run_until_complete(stream.read(0))
142 self.assertEqual(b'', data)
143 self.assertEqual(self.DATA, stream._buffer)
144
145 def test_read(self):
146 # Read bytes.

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