(data, src_encoding, dest_encoding, chunk_sizes)
| 1835 | |
| 1836 | |
| 1837 | def check_transcoding(data, src_encoding, dest_encoding, chunk_sizes): |
| 1838 | chunk_sizes = iter(chunk_sizes) |
| 1839 | stream = pa.transcoding_input_stream( |
| 1840 | pa.BufferReader(data.encode(src_encoding)), |
| 1841 | src_encoding, dest_encoding) |
| 1842 | out = [] |
| 1843 | while True: |
| 1844 | buf = stream.read(next(chunk_sizes)) |
| 1845 | out.append(buf) |
| 1846 | if not buf: |
| 1847 | break |
| 1848 | out = b''.join(out) |
| 1849 | assert out.decode(dest_encoding) == data |
| 1850 | |
| 1851 | |
| 1852 | @pytest.mark.parametrize('src_encoding, dest_encoding', |
no test coverage detected