forked from zarr-developers/zarr-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from d-v-b/mdurant_v3_fsspec
Mdurant v3 fsspec
- Loading branch information
Showing
5 changed files
with
92 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
tests/v3/test_store.py → tests/v3/test_store/test_local.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from __future__ import annotations | ||
|
||
import pytest | ||
|
||
from zarr.buffer import Buffer | ||
from zarr.store.memory import MemoryStore | ||
from zarr.testing.store import StoreTests | ||
|
||
|
||
class TestMemoryStore(StoreTests[MemoryStore]): | ||
store_cls = MemoryStore | ||
|
||
def set(self, store: MemoryStore, key: str, value: Buffer) -> None: | ||
store._store_dict[key] = value | ||
|
||
def get(self, store: MemoryStore, key: str) -> Buffer: | ||
return store._store_dict[key] | ||
|
||
@pytest.fixture(scope="function", params=[None, {}]) | ||
def store_kwargs(self, request) -> dict[str, str | None | dict[str, Buffer]]: | ||
return {"store_dict": request.param, "mode": "w"} | ||
|
||
@pytest.fixture(scope="function") | ||
def store(self, store_kwargs: str | None | dict[str, Buffer]) -> MemoryStore: | ||
return self.store_cls(**store_kwargs) | ||
|
||
def test_store_repr(self, store: MemoryStore) -> None: | ||
assert str(store) == f"memory://{id(store._store_dict)}" | ||
|
||
def test_store_supports_writes(self, store: MemoryStore) -> None: | ||
assert store.supports_writes | ||
|
||
def test_store_supports_listing(self, store: MemoryStore) -> None: | ||
assert store.supports_listing | ||
|
||
def test_store_supports_partial_writes(self, store: MemoryStore) -> None: | ||
assert store.supports_partial_writes | ||
|
||
def test_list_prefix(self, store: MemoryStore) -> None: | ||
assert True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters