MCPcopy
hub / github.com/encode/httpx / test_text_decoder_known_encoding

Function test_text_decoder_known_encoding

tests/test_decoders.py:267–280  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

265
266@pytest.mark.anyio
267async def test_text_decoder_known_encoding():
268 async def iterator() -> typing.AsyncIterator[bytes]:
269 yield b"\x83g"
270 yield b"\x83"
271 yield b"\x89\x83x\x83\x8b"
272
273 response = httpx.Response(
274 200,
275 headers=[(b"Content-Type", b"text/html; charset=shift-jis")],
276 content=iterator(),
277 )
278
279 await response.aread()
280 assert "".join(response.text) == "トラベル"
281
282
283def test_text_decoder_empty_cases():

Callers

nothing calls this directly

Calls 3

areadMethod · 0.95
iteratorFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected