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

Method test_json_custom_loader

tests/test_client_response.py:187–196  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

185 self.assertIsNone(self.response._connection)
186
187 def test_json_custom_loader(self):
188 self.response.headers = {
189 'CONTENT-TYPE': 'application/json;charset=cp1251'}
190 self.response._content = b'data'
191
192 def custom(content):
193 return content + '-custom'
194
195 res = self.loop.run_until_complete(self.response.json(loads=custom))
196 self.assertEqual(res, 'data-custom')
197
198 @unittest.mock.patch('aiohttp.client_reqrep.client_logger')
199 def test_json_no_content(self, m_log):

Callers

nothing calls this directly

Calls 1

jsonMethod · 0.45

Tested by

no test coverage detected