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

Source from the content-addressed store, hash-verified

1913
1914
1915def test_input_stream_duck_typing():
1916 # Accept objects having the right file-like methods...
1917 class DuckReader:
1918
1919 def close(self):
1920 pass
1921
1922 @property
1923 def closed(self):
1924 return False
1925
1926 def read(self, nbytes=None):
1927 return b'hello'
1928
1929 stream = pa.input_stream(DuckReader())
1930 assert stream.read(5) == b'hello'
1931
1932
1933def 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