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

Function test_unset_parser_stop

tests/test_stream_parser.py:326–339  ·  view source on GitHub ↗
(loop)

Source from the content-addressed store, hash-verified

324
325
326def test_unset_parser_stop(loop):
327 def p(out, buf):
328 try:
329 while True:
330 yield # read chunk
331 except parsers.EofStream:
332 out.feed_eof()
333
334 stream = parsers.StreamParser(loop=loop)
335 s = stream.set_parser(p)
336
337 stream.feed_data(b'line1')
338 stream.unset_parser()
339 assert s._eof
340
341
342def test_eof_exc(loop):

Callers

nothing calls this directly

Calls 3

set_parserMethod · 0.95
feed_dataMethod · 0.95
unset_parserMethod · 0.95

Tested by

no test coverage detected