()
| 265 | |
| 266 | @pytest.mark.anyio |
| 267 | async 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 | |
| 283 | def test_text_decoder_empty_cases(): |