From 01b872ec47ef4061624be4a0a361d6f0f2a45637 Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Sat, 12 Feb 2022 20:13:29 +0000 Subject: [PATCH] add wrf nml test --- tests/core/test_namelist.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/core/test_namelist.py b/tests/core/test_namelist.py index 89bb241..a378d01 100644 --- a/tests/core/test_namelist.py +++ b/tests/core/test_namelist.py @@ -27,4 +27,34 @@ def test_wps_namelist_verify_invalid(): } } with pytest.raises(ValueError): - gis4wrf.core.verify_namelist(namelist, 'wps') \ No newline at end of file + gis4wrf.core.verify_namelist(namelist, 'wps') + + +def test_wrf_namelist_verify_valid(): + namelist = { + 'time_control': { + 'start_year': [2018, 2018], + 'interval_seconds': 21600, + 'input_from_file': [True, True], + 'restart': False, + 'restart_interval': 7200, + 'io_form_history': 2 + }, + 'domains': { + 'time_step': 40, + 'max_dom': 2 + }, + 'physics': { + 'physics_suite': 'CONUS' + } + } + gis4wrf.core.verify_namelist(namelist, 'wrf') + +def test_wrf_namelist_verify_invalid(): + namelist = { + 'time_control': { + 'start_year': ['2018'] + } + } + with pytest.raises(TypeError): + gis4wrf.core.verify_namelist(namelist, 'wrf')