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

Function test_compression_default_coding

tests/test_web_response.py:570–585  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

568
569@pytest.mark.usefixtures("parametrize_zlib_backend")
570async def test_compression_default_coding() -> None:
571 req = make_request(
572 "GET", "/", headers=CIMultiDict({hdrs.ACCEPT_ENCODING: "gzip, deflate"})
573 )
574 resp = StreamResponse()
575 assert not resp.chunked
576
577 assert not resp.compression
578 resp.enable_compression()
579 assert resp.compression
580
581 msg = await resp.prepare(req)
582
583 msg.enable_compression.assert_called_with("deflate", None)
584 assert "deflate" == resp.headers.get(hdrs.CONTENT_ENCODING)
585 assert msg.filter is not None
586
587
588@pytest.mark.usefixtures("parametrize_zlib_backend")

Callers

nothing calls this directly

Calls 5

enable_compressionMethod · 0.95
prepareMethod · 0.95
StreamResponseClass · 0.90
make_requestFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected