MCPcopy
hub / github.com/aio-libs/aiohttp / test_read

Method test_read

tests/test_streams.py:99–113  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

97 self.assertEqual(self.DATA, data)
98
99 def test_read(self):
100 # Read bytes.
101 stream = self._make_one()
102 read_task = asyncio.Task(stream.read(30), loop=self.loop)
103
104 def cb():
105 stream.feed_data(self.DATA)
106 self.loop.call_soon(cb)
107
108 data = self.loop.run_until_complete(read_task)
109 self.assertEqual(self.DATA, data)
110
111 stream.feed_eof()
112 data = self.loop.run_until_complete(stream.read())
113 self.assertEqual(b'', data)
114
115 def test_read_line_breaks(self):
116 # Read bytes without line breaks.

Callers

nothing calls this directly

Calls 3

_make_oneMethod · 0.95
readMethod · 0.45
feed_eofMethod · 0.45

Tested by

no test coverage detected