CIME.tests package


CIME.tests.base module

CIME.tests.case_fake module

This module contains a fake implementation of the Case class that can be used for testing the tests.

class CIME.tests.case_fake.CaseFake(case_root, create_case_root=True)[source]

Bases: object

case_setup(clean=False, test_mode=False, reset=False)[source]
copy(newcasename, newcaseroot)[source]

Create and return a copy of self, but with CASE and CASEBASEID set to newcasename, CASEROOT set to newcaseroot, and RUNDIR set appropriately.


newcasename (str): new value for CASE newcaseroot (str): new value for CASEROOT

create_clone(newcase, keepexe=False, mach_dir=None, project=None, cime_output_root=None, exeroot=None, rundir=None)[source]

Create a clone of the current case. Also creates the CASEROOT directory for the clone case (given by newcase).

newcase (str): full path to the new case. This directory should not

already exist; it will be created

keepexe (bool, optional): Ignored mach_dir (str, optional): Ignored project (str, optional): Ignored cime_output_root (str, optional): New CIME_OUTPUT_ROOT for the clone exeroot (str, optional): New EXEROOT for the clone rundir (str, optional): New RUNDIR for the clone

Returns the clone case object


Get the value of the given item

Returns None if item isn’t set for this case


item (str): variable of interest


Make directory given by RUNDIR


Assumes CASEROOT is already set; sets an appropriate EXEROOT (nested inside CASEROOT)


Assumes CASEROOT is already set; sets an appropriate RUNDIR (nested inside CASEROOT)

set_value(item, value)[source]

Set the value of the given item to the given value


item (str): variable of interest value (any type): new value for item

CIME.tests.custom_assertions_test_status module

CIME.tests.scripts_regression_tests module

CIME.tests.test_sys_bless_tests_results module

CIME.tests.test_sys_build_system module

CIME.tests.test_sys_cime_case module

CIME.tests.test_sys_cime_performance module

CIME.tests.test_sys_create_newcase module

CIME.tests.test_sys_full_system module

CIME.tests.test_sys_grid_generation module

CIME.tests.test_sys_jenkins_generic_job module

CIME.tests.test_sys_manage_and_query module

CIME.tests.test_sys_query_config module

CIME.tests.test_sys_run_restart module

CIME.tests.test_sys_save_timings module

CIME.tests.test_sys_single_submit module

CIME.tests.test_sys_test_scheduler module

CIME.tests.test_sys_unittest module

CIME.tests.test_sys_user_concurrent_mods module

CIME.tests.test_sys_wait_for_tests module

CIME.tests.test_unit_aprun module

CIME.tests.test_unit_baselines_performance module

CIME.tests.test_unit_bless_test_results module

CIME.tests.test_unit_case module

CIME.tests.test_unit_case_fake module

This module contains unit tests of CaseFake

class CIME.tests.test_unit_case_fake.TestCaseFake(methodName='runTest')[source]

Bases: TestCase


Hook method for setting up the test fixture before exercising it.


Hook method for deconstructing the test fixture after testing it.


CIME.tests.test_unit_case_run module

CIME.tests.test_unit_case_setup module

CIME.tests.test_unit_compare_test_results module

CIME.tests.test_unit_compare_two module

CIME.tests.test_unit_config module

CIME.tests.test_unit_cs_status module

CIME.tests.test_unit_custom_assertions_test_status module

CIME.tests.test_unit_doctest module

CIME.tests.test_unit_expected_fails_file module

CIME.tests.test_unit_grids module

CIME.tests.test_unit_hist_utils module

CIME.tests.test_unit_locked_files module

CIME.tests.test_unit_nmlgen module

CIME.tests.test_unit_paramgen module

This module tests some functionality of CIME.ParamGen.paramgen’s ParamGen class

class CIME.tests.test_unit_paramgen.DummyCase[source]

Bases: object

A dummy Case class that mimics CIME class objects’ get_value method.

class CIME.tests.test_unit_paramgen.TestParamGen(methodName='runTest')[source]

Bases: TestCase

Tests some basic functionality of the CIME.ParamGen.paramgen’s ParamGen class


Tests the reduce method of ParamGen expandable vars in guards.


Tests the formula expansion feature of ParamGen.


Tests the ParamGen initializer with and without an initial data.


Tests the default behavior of returning the last match and the optional behavior of returning the first match.


Tests the reduce method of ParamGen on data with nested guards.


Tests the reduce method on data with outer guards enclosing parameter definitions.


Tests the reduce method of ParamGen on data with explicit guards (True or False).


Tests the reduce method of ParamGen on nested guards where an undefined expandable var is specified below a guard that evaluates to False. The undefined var should not lead to an error since the enclosing guard evaluates to false.

class CIME.tests.test_unit_paramgen.TestParamGenXmlConstructor(methodName='runTest')[source]

Bases: TestCase

A unit test class for testing ParamGen’s xml constructor.


Test to check if default val is assigned when all guards eval to False


Test to make sure duplicate ids raise the correct error when the “no_duplicates” flag is True.


Tests multiple key=value guards mixed with explicit (flexible) guards.


Tests multiple key=value guards mixed with explicit (flexible) guards with match=first option.


Tests an xml entry with no match, i.e., no guards evaluating to True.


Test xml entry values with single key=value guards

class CIME.tests.test_unit_paramgen.TestParamGenYamlConstructor(methodName='runTest')[source]

Bases: TestCase

A unit test class for testing ParamGen’s yaml constructor.


Test mom.input_data_list file generation via a subset of original input_data_list.yaml


Test MOM_input file generation via a subset of original MOM_input.yaml

CIME.tests.test_unit_system_tests module

CIME.tests.test_unit_test_status module

CIME.tests.test_unit_user_mod_support module

CIME.tests.test_unit_user_nl_utils module

class CIME.tests.test_unit_user_nl_utils.TestUserNLCopier(methodName='runTest')[source]

Bases: TestCase

assertFileContentsEqual(expected, filepath, msg=None)[source]

Asserts that the contents of the file given by ‘filepath’ are equal to the string given by ‘expected’. ‘msg’ gives an optional message to be printed if the assertion fails.


Hook method for setting up the test fixture before exercising it.


Hook method for deconstructing the test fixture after testing it.

write_user_nl_file(component, contents, suffix='')[source]

Write contents to a user_nl file in the case directory. Returns the basename (i.e., not the full path) of the file that is created.

For a component foo, with the default suffix of ‘’, the file name will be user_nl_foo

If the suffix is ‘_0001’, the file name will be user_nl_foo_0001

CIME.tests.test_unit_utils module

CIME.tests.test_unit_xml_archive_base module

CIME.tests.test_unit_xml_env_batch module

CIME.tests.test_unit_xml_env_mach_specific module

CIME.tests.test_unit_xml_machines module

CIME.tests.test_unit_xml_namelist_definition module

CIME.tests.test_unit_xml_tests module

CIME.tests.utils module

Module contents