diff --git a/python/ctsm/test/test_sys_run_tower.py b/python/ctsm/test/test_sys_run_tower.py index 0066ea1171..b1eef6c3a9 100755 --- a/python/ctsm/test/test_sys_run_tower.py +++ b/python/ctsm/test/test_sys_run_tower.py @@ -12,7 +12,7 @@ import sys from ctsm import unit_testing -from python.ctsm.site_and_regional.run_tower import main +from ctsm.site_and_regional.run_tower import main from ctsm.path_utils import path_to_ctsm_root # Allow test names that pylint doesn't like; otherwise hard to make them @@ -21,7 +21,14 @@ class TestSysRunTower(unittest.TestCase): - """System tests for run_tower""" + """ + System tests for run_tower + + TODO: Would also be useful to test the following items: + Ensure the log files are working as expected? + Test use of base case root. + Test for using prism + """ def setUp(self): """ @@ -46,19 +53,23 @@ def test_one_site(self): """ # run the run_tower tool + print("about to run tower tool") sys.argv = [ os.path.join(path_to_ctsm_root(), "tools", "site_and_regional", "run_tower"), "--neon-sites", "BART", "--setup-only", + "--experiment", + "TEST", "--output-root", - "--experiment TEST", self._tempdir, ] + print(sys.argv) main("") # assert that BART directories were created during setup self.assertTrue("BART" in glob.glob(self._tempdir + "/BART*")[0]) + print(glob.glob(self._tempdir)) def test_ad_site(self): """ @@ -72,8 +83,9 @@ def test_ad_site(self): "--neon-sites", "ABBY", "--setup-only", + "--run-type", + "ad", "--output-root", - "--run-type ad", self._tempdir, ] main("") @@ -81,12 +93,6 @@ def test_ad_site(self): # assert that ABBY directories were created during setup self.assertTrue("ABBY" in glob.glob(self._tempdir + "/ABBY*")[0]) - # TODO: Would also be useful to test the following items: - # It might be good to ensure the log files are working as expected? - # Test running transient, ad and post ad cases. - # Test use of base case root. - # Test for using prism? - def test_plumber_site(self): """ This test specifies a site to run a default plumber AD case with @@ -99,8 +105,9 @@ def test_plumber_site(self): "--plumber-sites", "AR-SLu", "--setup-only", + "--experiment", + "TEST", "--output-root", - "--experiment TEST", self._tempdir, ] main("") diff --git a/python/ctsm/test/test_unit_tower_arg_parse.py b/python/ctsm/test/test_unit_tower_arg_parse.py index 11d88d2330..c9e97e4db9 100755 --- a/python/ctsm/test/test_unit_tower_arg_parse.py +++ b/python/ctsm/test/test_unit_tower_arg_parse.py @@ -87,7 +87,7 @@ def test_plumber(self): ] description = "" cesmroot = path_to_ctsm_root() - + valid_neon_sites = glob.glob( os.path.join(cesmroot, "cime_config", "usermods_dirs", "NEON", "[!Fd]*") )