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

Function test_python_file_read_at

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

Source from the content-addressed store, hash-verified

180
181
182def test_python_file_read_at():
183 data = b'some sample data'
184
185 buf = BytesIO(data)
186 f = pa.PythonFile(buf, mode='r')
187
188 # test simple read at
189 v = f.read_at(nbytes=5, offset=3)
190 assert v == b'e sam'
191 assert len(v) == 5
192
193 # test reading entire file when nbytes > len(file)
194 w = f.read_at(nbytes=50, offset=0)
195 assert w == data
196 assert len(w) == 16
197
198
199def test_python_file_readall():

Callers

nothing calls this directly

Calls 2

lenFunction · 0.85
PythonFileMethod · 0.80

Tested by

no test coverage detected