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

Function test_input_stream_duck_typing

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

Source from the content-addressed store, hash-verified

1888
1889
1890def test_input_stream_duck_typing():
1891 # Accept objects having the right file-like methods...
1892 class DuckReader:
1893
1894 def close(self):
1895 pass
1896
1897 @property
1898 def closed(self):
1899 return False
1900
1901 def read(self, nbytes=None):
1902 return b'hello'
1903
1904 stream = pa.input_stream(DuckReader())
1905 assert stream.read(5) == b'hello'
1906
1907
1908def test_input_stream_file_path(tmpdir):

Callers

nothing calls this directly

Calls 2

DuckReaderClass · 0.85
readMethod · 0.45

Tested by

no test coverage detected