Esempio n. 1
0
def test_get_level_list(metplus_config, data_type, config_list, expected_list):
    config = metplus_config()
    config.set('config', f'{data_type}_LEVEL_LIST', config_list)

    saw = StatAnalysisWrapper(config)

    assert (saw.get_level_list(data_type) == expected_list)
Esempio n. 2
0
def test_get_config_file(metplus_config):
    fake_config_name = '/my/config/file'
    config = metplus_config()
    config.set('config', 'INPUT_MUST_EXIST', False)

    wrapper = StatAnalysisWrapper(config)
    assert not wrapper.c_dict['CONFIG_FILE']

    config.set('config', 'STAT_ANALYSIS_CONFIG_FILE', fake_config_name)
    wrapper = StatAnalysisWrapper(config)
    assert wrapper.c_dict['CONFIG_FILE'] == fake_config_name
def stat_analysis_wrapper():
    """! Returns a default StatAnalysisWrapper with /path/to entries in the
         metplus_system.conf and metplus_runtime.conf configuration
         files.  Subsequent tests can customize the final METplus configuration
         to over-ride these /path/to values."""

    # Default, empty StatAnalysisWrapper with some configuration values set
    # to /path/to:
    config = metplus_config()
    util.handle_tmp_dir(config)
    return StatAnalysisWrapper(config, config.logger)
Esempio n. 4
0
def stat_analysis_wrapper(metplus_config):
    """! Returns a default StatAnalysisWrapper with /path/to entries in the
         metplus_system.conf and metplus_runtime.conf configuration
         files.  Subsequent tests can customize the final METplus configuration
         to over-ride these /path/to values."""

    # Default, empty StatAnalysisWrapper with some configuration values set
    # to /path/to:
    extra_configs = []
    extra_configs.append(os.path.join(os.path.dirname(__file__), 'test.conf'))
    config = metplus_config(extra_configs)
    util.handle_tmp_dir(config)
    return StatAnalysisWrapper(config)