Skip to content

Commit

Permalink
Add test suggested in conda-forge#182 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Zimmermann committed Jul 20, 2023
1 parent fb8f36b commit 6929d02
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,15 @@ requirements:
- aws-sdk-cpp

test:
files:
- test_netcdf.py
requires:
- xarray
commands:
- test ! -f ${PREFIX}/lib/libnetcdf.a # [not win]
- test -f ${PREFIX}/lib/libnetcdf${SHLIB_EXT} # [not win]
- nc-config --all # [not win]
- python -c "import test_netcdf; test_netcdf.test_netcdf"

about:
home: http://www.unidata.ucar.edu/software/netcdf/
Expand Down
14 changes: 14 additions & 0 deletions recipe/test_netcdf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import xarray as xr


def test_netcdf():
fk = "test.nc"
ds = xr.Dataset(
coords={"nx": [0], "ny": [0]},
attrs={
"source": "satpy unit test",
"time_coverage_start": "0001-01-01T00:00:00Z",
"time_coverage_end": "0001-01-01T01:00:00Z",
}
)
ds.to_netcdf(fk)

0 comments on commit 6929d02

Please sign in to comment.