()
| 315 | |
| 316 | @pytest.mark.run_loop |
| 317 | def test_force_compression_gzip(): |
| 318 | req = make_request( |
| 319 | 'GET', '/', |
| 320 | headers=CIMultiDict({hdrs.ACCEPT_ENCODING: 'gzip, deflate'})) |
| 321 | resp = StreamResponse() |
| 322 | |
| 323 | resp.enable_compression(ContentCoding.gzip) |
| 324 | assert resp.compression |
| 325 | |
| 326 | with mock.patch('aiohttp.web_reqrep.ResponseImpl'): |
| 327 | msg = yield from resp.prepare(req) |
| 328 | msg.add_compression_filter.assert_called_with('gzip') |
| 329 | assert 'gzip' == resp.headers.get(hdrs.CONTENT_ENCODING) |
| 330 | |
| 331 | |
| 332 | @pytest.mark.run_loop |
nothing calls this directly
no test coverage detected