Skip to content

Commit 1922d2d

Browse files
committed
Test check_writeable and close for WrapperStore
1 parent e1caef0 commit 1922d2d

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

tests/test_store/test_wrapper.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ def store_kwargs(self, tmpdir: LEGACY_PATH) -> dict[str, str]:
3636
def open_kwargs(self, tmpdir) -> dict[str, str]:
3737
return {"store_cls": LocalStore, "root": str(tmpdir)}
3838

39-
@pytest.fixture
40-
def store(self, store_kwargs: dict[str, str]) -> WrapperStore:
41-
return self.store_cls(**store_kwargs)
42-
4339
def test_store_supports_writes(self, store: WrapperStore) -> None:
4440
assert store.supports_writes
4541

@@ -55,8 +51,21 @@ def test_store_repr(self, store: WrapperStore) -> None:
5551
def test_store_str(self, store: WrapperStore) -> None:
5652
assert str(store) == f"wrapping-file://{store._store.root.as_posix()}"
5753

54+
def test_check_writeable(self, store: WrapperStore) -> None:
55+
"""
56+
Test _check_writeable() runs without errors.
57+
"""
58+
store._check_writable()
59+
60+
def test_close(self, store: WrapperStore) -> None:
61+
"Test store can be closed"
62+
store.close()
63+
assert not store._is_open
64+
5865
def test_is_open_setter_raises(self, store: WrapperStore) -> None:
59-
"Test that a user cannot change `_is_open` without opening the underlying store."
66+
"""
67+
Test that a user cannot change `_is_open` without opening the underlying store.
68+
"""
6069
with pytest.raises(
6170
NotImplementedError, match="WrapperStore must be opened via the `_open` method"
6271
):

0 commit comments

Comments
 (0)