()
| 1888 | |
| 1889 | |
| 1890 | def 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 | |
| 1908 | def test_input_stream_file_path(tmpdir): |
nothing calls this directly
no test coverage detected