Пример #1
0
 async def _read_chunk(self, size: int) -> bytes:
     data = await self._reader.read(size + 2)
     return _parse_chunk(data, size)
Пример #2
0
def test_chunk_unexpected_eof() -> None:
    with pytest.raises(ConnectionError) as e:
        _parse_chunk(b"ABC\r\n", 4)
    assert e.value.args[0] == "Unexpected EOF reading chunk"