MCPcopy Create free account
hub / github.com/apache/arrow / test_buffered_input_stream_detach_seekable

Function test_buffered_input_stream_detach_seekable

python/pyarrow/tests/test_io.py:1512–1522  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1510
1511
1512def test_buffered_input_stream_detach_seekable():
1513 # detach() to a seekable file (io::RandomAccessFile in C++)
1514 f = pa.BufferedInputStream(pa.BufferReader(b"123456789"), buffer_size=4)
1515 assert f.read(2) == b"12"
1516 raw = f.detach()
1517 assert f.closed
1518 assert not raw.closed
1519 assert raw.seekable()
1520 assert raw.read(4) == b"5678"
1521 raw.seek(2)
1522 assert raw.read(4) == b"3456"
1523
1524
1525def test_buffered_input_stream_detach_non_seekable():

Callers

nothing calls this directly

Calls 4

BufferedInputStreamMethod · 0.80
BufferReaderMethod · 0.80
seekMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected