()
| 2218 | |
| 2219 | |
| 2220 | def test_fsspec_filesystem_from_uri(): |
| 2221 | try: |
| 2222 | from fsspec.implementations.local import LocalFileSystem |
| 2223 | from fsspec.implementations.memory import MemoryFileSystem |
| 2224 | except ImportError: |
| 2225 | pytest.skip("fsspec not installed") |
| 2226 | |
| 2227 | fs, path = FileSystem.from_uri("fsspec+memory://path/to/data.parquet") |
| 2228 | expected_fs = PyFileSystem(FSSpecHandler(MemoryFileSystem())) |
| 2229 | assert fs == expected_fs |
| 2230 | assert path == "/path/to/data.parquet" |
| 2231 | |
| 2232 | # check that if fsspec+ is specified than we don't coerce to the native |
| 2233 | # arrow local filesystem |
| 2234 | uri = "file:///tmp/my.file" |
| 2235 | fs, _ = FileSystem.from_uri(f"fsspec+{uri}") |
| 2236 | expected_fs = PyFileSystem(FSSpecHandler(LocalFileSystem())) |
| 2237 | assert fs == expected_fs |
| 2238 | |
| 2239 | |
| 2240 | def test_fsspec_delete_root_dir_contents(): |
nothing calls this directly
no test coverage detected