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

Function test_open_input_file

python/pyarrow/tests/test_fs.py:1041–1057  ·  view source on GitHub ↗
(fs, pathfn)

Source from the content-addressed store, hash-verified

1039
1040
1041def test_open_input_file(fs, pathfn):
1042 p = pathfn('open-input-file')
1043
1044 data = b'some data' * 1024
1045 with fs.open_output_stream(p) as s:
1046 s.write(data)
1047
1048 read_from = len(b'some data') * 512
1049 with fs.open_input_file(p) as f:
1050 result = f.read()
1051 assert result == data
1052
1053 with fs.open_input_file(p) as f:
1054 f.seek(read_from)
1055 result = f.read()
1056
1057 assert result == data[read_from:]
1058
1059
1060def test_open_input_stream_not_found(fs, pathfn):

Callers

nothing calls this directly

Calls 7

pathfnFunction · 0.85
lenFunction · 0.85
seekMethod · 0.80
open_output_streamMethod · 0.45
writeMethod · 0.45
open_input_fileMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected