From 4949d143dde0bf1b8c72eb33014c72223313eb79 Mon Sep 17 00:00:00 2001 From: Austin Raney Date: Thu, 22 Feb 2024 09:20:56 -0500 Subject: [PATCH] test: lgar --- python/ngen_conf/tests/conftest.py | 6 ++++++ python/ngen_conf/tests/test_init_config_models.py | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/python/ngen_conf/tests/conftest.py b/python/ngen_conf/tests/conftest.py index a89058b9..431d809c 100644 --- a/python/ngen_conf/tests/conftest.py +++ b/python/ngen_conf/tests/conftest.py @@ -18,6 +18,7 @@ _noah_owp_config_data_path = _datadir / "init_config_data" / "noah_owp.namelist" _soil_freeze_thaw_config_data_path = _datadir / "init_config_data" / "soil_freeze_thaw.txt" _soil_moisture_profile_config_data_path = _datadir / "init_config_data" / "soil_moisture_profile.txt" +_lgar_config_data_path = _datadir / "init_config_data" / "lgar.txt" """ @@ -172,3 +173,8 @@ def soil_freeze_thaw_init_config() -> str: def soil_moisture_profile_init_config() -> str: # drop eol char return _soil_moisture_profile_config_data_path.read_text().rstrip() + +@pytest.fixture +def lgar_init_config() -> str: + # drop eol char + return _lgar_config_data_path.read_text().rstrip() diff --git a/python/ngen_conf/tests/test_init_config_models.py b/python/ngen_conf/tests/test_init_config_models.py index a923bed8..4681a4a7 100644 --- a/python/ngen_conf/tests/test_init_config_models.py +++ b/python/ngen_conf/tests/test_init_config_models.py @@ -1,9 +1,10 @@ -from ngen.init_config import utils from ngen.config.init_config.cfe import CFE -from ngen.config.init_config.pet import PET +from ngen.config.init_config.lgar import Lgar from ngen.config.init_config.noahowp import NoahOWP +from ngen.config.init_config.pet import PET from ngen.config.init_config.soil_freeze_thaw import SoilFreezeThaw from ngen.config.init_config.soil_moisture_profile import SoilMoistureProfile +from ngen.init_config import utils def test_cfe(cfe_init_config: str): @@ -33,3 +34,7 @@ def test_soil_freeze_thaw(soil_freeze_thaw_init_config: str): def test_soil_moisture_profile(soil_moisture_profile_init_config: str): o = SoilMoistureProfile.from_ini_str(soil_moisture_profile_init_config) assert o.to_ini_str() == soil_moisture_profile_init_config + +def test_lgar(lgar_init_config: str): + o = Lgar.from_ini_str(lgar_init_config) + assert o.to_ini_str() == lgar_init_config