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

Method test_read_line_breaks

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

Source from the content-addressed store, hash-verified

156 self.assertEqual(b'', stream._buffer)
157
158 def test_read_line_breaks(self):
159 # Read bytes without line breaks.
160 stream = asyncio.StreamReader(loop=self.loop)
161 stream.feed_data(b'line1')
162 stream.feed_data(b'line2')
163
164 data = self.loop.run_until_complete(stream.read(5))
165
166 self.assertEqual(b'line1', data)
167 self.assertEqual(b'line2', stream._buffer)
168
169 def test_read_eof(self):
170 # Read bytes, stop at eof.

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