()
| 1572 | |
| 1573 | @pytest.mark.numpy |
| 1574 | def test_buffered_output_stream(): |
| 1575 | np_buf = np.zeros(100, dtype=np.int8) # zero-initialized buffer |
| 1576 | buf = pa.py_buffer(np_buf) |
| 1577 | |
| 1578 | raw = pa.FixedSizeBufferWriter(buf) |
| 1579 | f = pa.BufferedOutputStream(raw, buffer_size=4) |
| 1580 | f.write(b"12") |
| 1581 | assert np_buf[:4].tobytes() == b'\0\0\0\0' |
| 1582 | f.flush() |
| 1583 | assert np_buf[:4].tobytes() == b'12\0\0' |
| 1584 | f.write(b"3456789") |
| 1585 | f.close() |
| 1586 | assert f.closed |
| 1587 | assert raw.closed |
| 1588 | assert np_buf[:10].tobytes() == b'123456789\0' |
| 1589 | |
| 1590 | |
| 1591 | @pytest.mark.numpy |
nothing calls this directly
no test coverage detected