CIME.tests package

Submodules

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.

Args:

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).

Args:
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

flush()[source]
get_value(item)[source]

Get the value of the given item

Returns None if item isn’t set for this case

Args:

item (str): variable of interest

load_env(reset=False)[source]
make_rundir()[source]

Make directory given by RUNDIR

set_exeroot()[source]

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

set_initial_test_values()[source]
set_rundir()[source]

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

Args:

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

setUp()[source]

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

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_create_clone()[source]

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.

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

Bases: TestCase

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

test_expandable_vars()[source]

Tests the reduce method of ParamGen expandable vars in guards.

test_formula_expansion()[source]

Tests the formula expansion feature of ParamGen.

test_init_data()[source]

Tests the ParamGen initializer with and without an initial data.

test_match()[source]

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

test_nested_reduce()[source]

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

test_outer_guards()[source]

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

test_reduce()[source]

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

test_undefined_var()[source]

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_default_var()[source]

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

test_duplicate_entry_error()[source]

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

test_mixed_guard()[source]

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

test_mixed_guard_first()[source]

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

test_no_match()[source]

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

test_single_key_val_guard()[source]

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_input_data_list()[source]

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

test_mom_input()[source]

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.

setUp()[source]

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

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_append()[source]
test_append_list()[source]
test_append_multiple_files()[source]
test_append_without_files_raises_exception()[source]
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