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

Method test_bytes_data

tests/test_client_request.py:516–527  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

514 self.loop.run_until_complete(req.close())
515
516 def test_bytes_data(self):
517 for meth in ClientRequest.POST_METHODS:
518 req = ClientRequest(
519 meth, 'http://python.org/',
520 data=b'binary data', loop=self.loop)
521 resp = req.send(self.transport, self.protocol)
522 self.assertEqual('/', req.path)
523 self.assertEqual(b'binary data', req.body)
524 self.assertEqual('application/octet-stream',
525 req.headers['CONTENT-TYPE'])
526 self.loop.run_until_complete(req.close())
527 resp.close()
528
529 @unittest.mock.patch('aiohttp.client_reqrep.aiohttp')
530 def test_content_encoding(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