diff --git a/recipe/meta.yaml b/recipe/meta.yaml index f1c24491..afb64f77 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -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/ diff --git a/recipe/test_netcdf.py b/recipe/test_netcdf.py new file mode 100644 index 00000000..721b80a4 --- /dev/null +++ b/recipe/test_netcdf.py @@ -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)