| 1249 | |
| 1250 | |
| 1251 | async 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 | |
| 1276 | async def test_data_continue(loop, buf, conn) -> None: |