(loop, buf, conn)
| 1142 | |
| 1143 | |
| 1144 | async def test_data_stream_deprecated(loop, buf, conn) -> None: |
| 1145 | with pytest.warns(DeprecationWarning): |
| 1146 | |
| 1147 | @aiohttp.streamer |
| 1148 | async def gen(writer): |
| 1149 | await writer.write(b"binary data") |
| 1150 | await writer.write(b" result") |
| 1151 | |
| 1152 | req = ClientRequest("POST", URL("http://python.org/"), data=gen(), loop=loop) |
| 1153 | assert req.chunked |
| 1154 | assert req.headers["TRANSFER-ENCODING"] == "chunked" |
| 1155 | |
| 1156 | resp = await req.send(conn) |
| 1157 | await resp.wait_for_close() |
| 1158 | assert ( |
| 1159 | 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" |
| 1160 | ) |
| 1161 | await req.close() |
| 1162 | |
| 1163 | |
| 1164 | async def test_data_file(loop, buf, conn) -> None: |
nothing calls this directly
no test coverage detected