MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / test_data_stream_continue

Function test_data_stream_continue

tests/test_client_request.py:1251–1273  ·  view source on GitHub ↗
(loop, buf, conn)

Source from the content-addressed store, hash-verified

1249
1250
1251async def test_data_stream_continue(loop, buf, conn) -> None:
1252 async def gen():
1253 yield b"binary data"
1254 yield b" result"
1255
1256 req = ClientRequest(
1257 "POST", URL("http://python.org/"), data=gen(), expect100=True, loop=loop
1258 )
1259 assert req.chunked
1260
1261 async def coro():
1262 await asyncio.sleep(0.0001)
1263 req._continue.set_result(1)
1264
1265 loop.create_task(coro())
1266
1267 resp = await req.send(conn)
1268 await req._writer
1269 assert (
1270 buf.split(b"\r\n\r\n", 1)[1] == b"b\r\nbinary data\r\n7\r\n result\r\n0\r\n\r\n"
1271 )
1272 await req.close()
1273 resp.close()
1274
1275
1276async def test_data_continue(loop, buf, conn) -> None:

Callers

nothing calls this directly

Calls 6

sendMethod · 0.95
closeMethod · 0.95
ClientRequestClass · 0.90
genFunction · 0.70
coroFunction · 0.70
closeMethod · 0.45

Tested by

no test coverage detected