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

Function test_content_encoding_header

tests/test_client_request.py:909–924  ·  view source on GitHub ↗
(loop, conn)

Source from the content-addressed store, hash-verified

907
908@pytest.mark.usefixtures("parametrize_zlib_backend")
909async def test_content_encoding_header(loop, conn) -> None:
910 req = ClientRequest(
911 "post",
912 URL("http://python.org/"),
913 data="foo",
914 headers={"Content-Encoding": "deflate"},
915 loop=loop,
916 )
917 with mock.patch("aiohttp.client_reqrep.StreamWriter") as m_writer:
918 m_writer.return_value.write_headers = mock.AsyncMock()
919 resp = await req.send(conn)
920
921 assert not m_writer.return_value.enable_compression.called
922 assert not m_writer.return_value.enable_chunking.called
923 await req.close()
924 resp.close()
925
926
927async def test_compress_and_content_encoding(loop, conn) -> None:

Callers

nothing calls this directly

Calls 5

sendMethod · 0.95
closeMethod · 0.95
ClientRequestClass · 0.90
patchMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected