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

Method test_content_encoding

tests/test_client_request.py:530–539  ·  view source on GitHub ↗
(self, m_http)

Source from the content-addressed store, hash-verified

528
529 @unittest.mock.patch('aiohttp.client_reqrep.aiohttp')
530 def test_content_encoding(self, m_http):
531 req = ClientRequest('get', 'http://python.org/',
532 compress='deflate', loop=self.loop)
533 resp = req.send(self.transport, self.protocol)
534 self.assertEqual(req.headers['TRANSFER-ENCODING'], 'chunked')
535 self.assertEqual(req.headers['CONTENT-ENCODING'], 'deflate')
536 m_http.Request.return_value\
537 .add_compression_filter.assert_called_with('deflate')
538 self.loop.run_until_complete(req.close())
539 resp.close()
540
541 @unittest.mock.patch('aiohttp.client_reqrep.aiohttp')
542 def test_content_encoding_header(self, m_http):

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected