Skip to content

Commit 026226e

Browse files
more tests
1 parent cf60208 commit 026226e

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# ZarrDatasets
22

3-
[![Build Status](https://github.com/JuliaGeo/ZarrDatasets.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JuliaGeo/ZarrDatasets.jl/actions/workflows/CI.yml?query=branch%3Amain)
43
[![Build Status](https://github.com/JuliaGeo/ZarrDatasets.jl/workflows/CI/badge.svg)](https://github.com/JuliaGeo/ZarrDatasets.jl/actions)
54
[![codecov.io](http://codecov.io/github/JuliaGeo/ZarrDatasets.jl/coverage.svg?branch=main)](http://app.codecov.io/github/JuliaGeo/ZarrDatasets.jl?branch=main)
65
[![documentation dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliageo.github.io/ZarrDatasets.jl/dev/)
@@ -9,7 +8,7 @@
98
ZarrDatasets.jl is a julia package to read [Zarr](https://zarr.dev/) datasets using the native julia implementation [Zarr.jl](https://github.com/JuliaIO/Zarr.jl)
109
using the [CommonDataModel.jl](https://github.com/JuliaGeo/CommonDataModel.jl) interface.
1110

12-
In the following example data from [Copernicus marine service](https://marine.copernicus.eu/) are loaded using `ZarrDatasets` and a subset
11+
In the following example, data from [Copernicus Marine Service](https://marine.copernicus.eu/) is loaded using `ZarrDatasets` and a subset
1312
is saved as a NetCDF file:
1413

1514

src/dataset.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ CDM.group(ds::ZarrDataset,name::SymbolOrString) = ZarrDataset(ds.zgroup.groups,S
5757

5858

5959
CDM.parentdataset(ds::ZarrDataset) = ds.parentdataset
60-
CDM.iswritable(ds::ZarrDataset) = true
60+
CDM.iswritable(ds::ZarrDataset) = false
6161
CDM.maskingvalue(ds::ZarrDataset) = ds.maskingvalue
6262

6363

test/Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[deps]
2+
CommonDataModel = "1fbeeb36-5f17-413c-809b-666fb144f157"
23
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
34
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
45
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
56

67
[compat]
7-
julia = "1"
88
NCDatasets = "0.14"
9+
julia = "1"

test/runtests.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ using Dates
22
using NCDatasets
33
using Test
44
using ZarrDatasets
5+
using CommonDataModel: iswritable, attribnames, parentdataset
56

67
@testset "ZarrDatasets.jl" begin
78
#fname = "/tmp/foo.zarr"
@@ -44,6 +45,15 @@ using ZarrDatasets
4445
@test ds2.attrib[attribname] == attribval
4546
end
4647

48+
io = IOBuffer()
49+
show(io,ds)
50+
str = String(take!(io))
51+
@test occursin("title",str)
52+
53+
@test !iswritable(ds)
54+
@test "title" in attribnames(ds)
55+
@test isnothing(parentdataset(ds))
56+
4757
close(ds)
4858
close(ds2)
4959
end

0 commit comments

Comments
 (0)