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

Method test_read_json_encoding

tests/test_multipart.py:396–401  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

394 self.assertEqual({'test': 'passed'}, result)
395
396 def test_read_json_encoding(self):
397 obj = aiohttp.multipart.BodyPartReader(
398 self.boundary, {CONTENT_TYPE: 'application/json'},
399 Stream('{"тест": "пассед"}\r\n--:--'.encode('cp1251')))
400 result = yield from obj.json(encoding='cp1251')
401 self.assertEqual({'тест': 'пассед'}, result)
402
403 def test_read_json_guess_encoding(self):
404 obj = aiohttp.multipart.BodyPartReader(

Callers

nothing calls this directly

Calls 3

jsonMethod · 0.95
encodeMethod · 0.80
StreamClass · 0.70

Tested by

no test coverage detected