Skip to content

Commit

Permalink
add test_cmip_vertical_coord to test_synthetic_data.py
Browse files Browse the repository at this point in the history
  • Loading branch information
wrongkindofdoctor committed Jan 4, 2022
1 parent 87ac9ff commit 4d3424e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mdtf_test_data/tests/test_synthetic_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,22 @@
from mdtf_test_data.synthetic.vertical import ncar_hybrid_coord
from mdtf_test_data.synthetic.vertical import mom6_z_coord
from mdtf_test_data.synthetic.vertical import mom6_rho2_coord
from mdtf_test_data.synthetic.vertical import cmip_vertical_coord

__all__ = [
"test_xr_times_from_tuples_ncar",
"test_write_to_netcdf",
"test_ncar_hybrid_coord",
"test_gfdl_plev19_vertical_coord",
"test_gfdl_vertical_coord",
"test_cmip_vertical_coord",
"test_mom6_z_coord",
"test_generate_random_array",
"test_generate_daily_time_axis",
"test_generate_hourly_time_axis",
"test_generate_monthly_time_axis",
"test_generate_synthetic_dataset",
"test_dataset_stats",
"test_dataset_stats"
]


Expand All @@ -44,7 +46,8 @@ def pytest_namespace():
"ncar_hybrid": None,
"gfdl_plev19": None,
"gfdl_vert": None,
"dummy_dset": None,
"cmip_vert": None,
"dummy_dset": None
}


Expand Down Expand Up @@ -107,6 +110,13 @@ def test_gfdl_vertical_coord():
pytest.gfdl_vert = result


def test_cmip_vertical_coord():
result = cmip_vertical_coord()
assert isinstance(result, xr.Dataset)
assert np.allclose(float(result.plev.sum()), 15030.0)
pytest.cmip_vert = result


def test_mom6_z_coord():
result = mom6_z_coord()
assert isinstance(result, xr.Dataset)
Expand Down

0 comments on commit 4d3424e

Please sign in to comment.