Skip to content

Commit

Permalink
TST: test no writing in read-only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
genematx committed Oct 24, 2024
1 parent 4afd5e4 commit 202f10e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tiled/_tests/test_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,14 @@ def test_dataframe_column(key, server, fs):
actual = arr[...]
expected = df[col]
assert numpy.array_equal(actual, expected)


def test_writing(server, fs):
url = f"http://localhost:{server.port}/zarr/v2/nested/array"

with pytest.raises(NotImplementedError):
grp = zarr.open(fs.get_mapper(url), mode="w")

with pytest.raises(zarr.errors.ReadOnlyError):
grp = zarr.open(fs.get_mapper(url), mode="r")
grp["random_2d"][0, 0] = 0.0

0 comments on commit 202f10e

Please sign in to comment.