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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

lenFunction · 0.85
PythonFileMethod · 0.80

Tested by

no test coverage detected