File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 66
77import pytest
88from botocore .session import Session
9+ from fsspec .implementations .asyn_wrapper import AsyncFileSystemWrapper
910
1011import zarr .api .asynchronous
1112from zarr .core .buffer import Buffer , cpu , default_buffer_prototype
@@ -214,3 +215,20 @@ async def test_empty_nonexistent_path(self, store_kwargs) -> None:
214215 store_kwargs ["path" ] += "/abc"
215216 store = await self .store_cls .open (** store_kwargs )
216217 assert await store .is_empty ("" )
218+
219+
220+
221+ def test_wrap_sync_filesystem ():
222+ """The local fs is not async so we should expect it to be wrapped automatically"""
223+ store = FsspecStore .from_url ("local://test/path" )
224+
225+ assert isinstance (store .fs , AsyncFileSystemWrapper )
226+ assert store .fs .async_impl
227+
228+
229+ def test_no_wrap_async_filesystem ():
230+ """An async fs should not be wrapped automatically; fsspec's https filesystem is such an fs"""
231+ store = FsspecStore .from_url ("https://test/path" )
232+
233+ assert not isinstance (store .fs , AsyncFileSystemWrapper )
234+ assert store .fs .async_impl
You can’t perform that action at this time.
0 commit comments