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

Source from the content-addressed store, hash-verified

1921
1922
1923def test_input_stream_duck_typing():
1924 # Accept objects having the right file-like methods...
1925 class DuckReader:
1926
1927 def close(self):
1928 pass
1929
1930 @property
1931 def closed(self):
1932 return False
1933
1934 def read(self, nbytes=None):
1935 return b'hello'
1936
1937 stream = pa.input_stream(DuckReader())
1938 assert stream.read(5) == b'hello'
1939
1940
1941def 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