1010import zarr .api .asynchronous
1111from zarr .core .buffer import Buffer , cpu , default_buffer_prototype
1212from zarr .core .sync import _collect_aiterator , sync
13- from zarr .storage import RemoteStore
13+ from zarr .storage import FsspecStore
1414from zarr .testing .store import StoreTests
1515
1616if TYPE_CHECKING :
@@ -84,7 +84,7 @@ def s3(s3_base: None) -> Generator[s3fs.S3FileSystem, None, None]:
8484
8585
8686async def test_basic () -> None :
87- store = RemoteStore .from_url (
87+ store = FsspecStore .from_url (
8888 f"s3://{ test_bucket_name } /foo/spam/" ,
8989 storage_options = {"endpoint_url" : endpoint_url , "anon" : False },
9090 )
@@ -102,8 +102,8 @@ async def test_basic() -> None:
102102 assert out [0 ].to_bytes () == data [1 :]
103103
104104
105- class TestRemoteStoreS3 (StoreTests [RemoteStore , cpu .Buffer ]):
106- store_cls = RemoteStore
105+ class TestFsspecStoreS3 (StoreTests [FsspecStore , cpu .Buffer ]):
106+ store_cls = FsspecStore
107107 buffer_cls = cpu .Buffer
108108
109109 @pytest .fixture
@@ -114,36 +114,36 @@ def store_kwargs(self, request) -> dict[str, str | bool]:
114114 return {"fs" : fs , "path" : path }
115115
116116 @pytest .fixture
117- def store (self , store_kwargs : dict [str , str | bool ]) -> RemoteStore :
117+ def store (self , store_kwargs : dict [str , str | bool ]) -> FsspecStore :
118118 return self .store_cls (** store_kwargs )
119119
120- async def get (self , store : RemoteStore , key : str ) -> Buffer :
120+ async def get (self , store : FsspecStore , key : str ) -> Buffer :
121121 # make a new, synchronous instance of the filesystem because this test is run in sync code
122122 new_fs = fsspec .filesystem (
123123 "s3" , endpoint_url = store .fs .endpoint_url , anon = store .fs .anon , asynchronous = False
124124 )
125125 return self .buffer_cls .from_bytes (new_fs .cat (f"{ store .path } /{ key } " ))
126126
127- async def set (self , store : RemoteStore , key : str , value : Buffer ) -> None :
127+ async def set (self , store : FsspecStore , key : str , value : Buffer ) -> None :
128128 # make a new, synchronous instance of the filesystem because this test is run in sync code
129129 new_fs = fsspec .filesystem (
130130 "s3" , endpoint_url = store .fs .endpoint_url , anon = store .fs .anon , asynchronous = False
131131 )
132132 new_fs .write_bytes (f"{ store .path } /{ key } " , value .to_bytes ())
133133
134- def test_store_repr (self , store : RemoteStore ) -> None :
135- assert str (store ) == "<RemoteStore (S3FileSystem, test)>"
134+ def test_store_repr (self , store : FsspecStore ) -> None :
135+ assert str (store ) == "<FsspecStore (S3FileSystem, test)>"
136136
137- def test_store_supports_writes (self , store : RemoteStore ) -> None :
137+ def test_store_supports_writes (self , store : FsspecStore ) -> None :
138138 assert store .supports_writes
139139
140- def test_store_supports_partial_writes (self , store : RemoteStore ) -> None :
140+ def test_store_supports_partial_writes (self , store : FsspecStore ) -> None :
141141 assert not store .supports_partial_writes
142142
143- def test_store_supports_listing (self , store : RemoteStore ) -> None :
143+ def test_store_supports_listing (self , store : FsspecStore ) -> None :
144144 assert store .supports_listing
145145
146- async def test_remote_store_from_uri (self , store : RemoteStore ) :
146+ async def test_fsspec_store_from_uri (self , store : FsspecStore ) -> None :
147147 storage_options = {
148148 "endpoint_url" : endpoint_url ,
149149 "anon" : False ,
@@ -188,7 +188,7 @@ def test_from_upath(self) -> None:
188188 anon = False ,
189189 asynchronous = True ,
190190 )
191- result = RemoteStore .from_upath (path )
191+ result = FsspecStore .from_upath (path )
192192 assert result .fs .endpoint_url == endpoint_url
193193 assert result .fs .asynchronous
194194 assert result .path == f"{ test_bucket_name } /foo/bar"
@@ -197,7 +197,7 @@ def test_init_raises_if_path_has_scheme(self, store_kwargs) -> None:
197197 # regression test for https://github.com/zarr-developers/zarr-python/issues/2342
198198 store_kwargs ["path" ] = "s3://" + store_kwargs ["path" ]
199199 with pytest .raises (
200- ValueError , match = "path argument to RemoteStore must not include scheme .*"
200+ ValueError , match = "path argument to FsspecStore must not include scheme .*"
201201 ):
202202 self .store_cls (** store_kwargs )
203203
0 commit comments