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

Method test_read_exception

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

Source from the content-addressed store, hash-verified

171 self.assertEqual(b'', data)
172
173 def test_read_exception(self):
174 stream = self._make_one()
175 stream.feed_data(b'line\n')
176
177 data = self.loop.run_until_complete(stream.read(2))
178 self.assertEqual(b'li', data)
179
180 stream.set_exception(ValueError())
181 self.assertRaises(
182 ValueError, self.loop.run_until_complete, stream.read(2))
183
184 def test_readline(self):
185 # Read one line. 'readline' will need to wait for the data

Callers

nothing calls this directly

Calls 4

_make_oneMethod · 0.95
feed_dataMethod · 0.45
readMethod · 0.45
set_exceptionMethod · 0.45

Tested by

no test coverage detected