MCPcopy
hub / github.com/aio-libs/aiohttp / test_force_compression_deflate

Function test_force_compression_deflate

tests/test_web_response.py:287–299  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

285
286@pytest.mark.run_loop
287def test_force_compression_deflate():
288 req = make_request(
289 'GET', '/',
290 headers=CIMultiDict({hdrs.ACCEPT_ENCODING: 'gzip, deflate'}))
291 resp = StreamResponse()
292
293 resp.enable_compression(ContentCoding.deflate)
294 assert resp.compression
295
296 with mock.patch('aiohttp.web_reqrep.ResponseImpl'):
297 msg = yield from resp.prepare(req)
298 msg.add_compression_filter.assert_called_with('deflate')
299 assert 'deflate' == resp.headers.get(hdrs.CONTENT_ENCODING)
300
301
302@pytest.mark.run_loop

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected