Skip to content

Commit

Permalink
adjust test to members caching
Browse files Browse the repository at this point in the history
  • Loading branch information
d-v-b committed Dec 10, 2024
1 parent 2d3c13a commit be5e389
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions xarray/tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -3274,7 +3274,7 @@ def test_get_array_keys(self, cache_array_keys: bool) -> None:
"""
with self.create_zarr_target() as store_target:
zstore = backends.ZarrStore.open_group(
store_target, mode="w", cache_array_keys=cache_array_keys
store_target, mode="w", cache_members=cache_array_keys
)

# ensure that the keys are sorted
Expand All @@ -3284,13 +3284,13 @@ def test_get_array_keys(self, cache_array_keys: bool) -> None:
for ak in array_keys:
zstore.zarr_group.create(name=ak, shape=(1,), dtype="uint8")

observed_keys_0 = sorted(zstore.get_array_keys())
observed_keys_0 = sorted(zstore.array_keys())
assert observed_keys_0 == array_keys

# create a new array
new_key = "baz"
zstore.zarr_group.create(name=new_key, shape=(1,), dtype="uint8")
observed_keys_1 = sorted(zstore.get_array_keys())
observed_keys_1 = sorted(zstore.array_keys())

if cache_array_keys:
assert observed_keys_1 == array_keys
Expand Down Expand Up @@ -3375,11 +3375,11 @@ def test_append(self) -> None:
}
else:
expected = {
"iter": 3,
"iter": 2,
"contains": 18,
"setitem": 10,
"getitem": 13,
"listdir": 2,
"listdir": 1,
"list_prefix": 2,
}

Expand Down Expand Up @@ -3477,11 +3477,11 @@ def test_region_write(self) -> None:
}
else:
expected = {
"iter": 2,
"iter": 1,
"contains": 4,
"setitem": 1,
"getitem": 4,
"listdir": 2,
"getitem": 5,
"listdir": 1,
"list_prefix": 0,
}

Expand Down

0 comments on commit be5e389

Please sign in to comment.