(loop, conn)
| 880 | |
| 881 | @pytest.mark.usefixtures("parametrize_zlib_backend") |
| 882 | async def test_content_encoding(loop, conn) -> None: |
| 883 | req = ClientRequest( |
| 884 | "post", URL("http://python.org/"), data="foo", compress="deflate", loop=loop |
| 885 | ) |
| 886 | with mock.patch("aiohttp.client_reqrep.StreamWriter") as m_writer: |
| 887 | m_writer.return_value.write_headers = mock.AsyncMock() |
| 888 | resp = await req.send(conn) |
| 889 | assert req.headers["TRANSFER-ENCODING"] == "chunked" |
| 890 | assert req.headers["CONTENT-ENCODING"] == "deflate" |
| 891 | m_writer.return_value.enable_compression.assert_called_with("deflate") |
| 892 | await req.close() |
| 893 | resp.close() |
| 894 | |
| 895 | |
| 896 | async def test_content_encoding_dont_set_headers_if_no_body(loop, conn) -> None: |
nothing calls this directly
no test coverage detected