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:1545–1555  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1543
1544
1545def test_buffered_input_stream_detach_seekable():
1546 # detach() to a seekable file (io::RandomAccessFile in C++)
1547 f = pa.BufferedInputStream(pa.BufferReader(b"123456789"), buffer_size=4)
1548 assert f.read(2) == b"12"
1549 raw = f.detach()
1550 assert f.closed
1551 assert not raw.closed
1552 assert raw.seekable()
1553 assert raw.read(4) == b"5678"
1554 raw.seek(2)
1555 assert raw.read(4) == b"3456"
1556
1557
1558def 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