()
| 1913 | |
| 1914 | |
| 1915 | def 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 | |
| 1933 | def test_input_stream_file_path(tmpdir): |
nothing calls this directly
no test coverage detected