예제 #1
0
def test_handle_regrid_new(metplus_config, config_overrides, expected_output):
    config = metplus_config()

    # set config values
    for key, value in config_overrides.items():
        config.set('config', key, value)

    cbw = CommandBuilder(config)

    # set app_name to grid_stat for testing
    cbw.app_name = 'app'

    cbw.handle_regrid(cbw.c_dict)
    assert cbw.env_var_dict['METPLUS_REGRID_DICT'] == expected_output
예제 #2
0
def test_handle_regrid_old(metplus_config, config_overrides, set_to_grid,
                           expected_dict):
    config = metplus_config()

    # set config values
    for key, value in config_overrides.items():
        config.set('config', key, value)

    cbw = CommandBuilder(config)

    # set app_name to grid_stat for testing
    cbw.app_name = 'app'

    # create empty dictionary for testing
    c_dict = {}

    cbw.handle_regrid(c_dict, set_to_grid=set_to_grid)

    assert len(c_dict) == len(expected_dict)
    for key, value in expected_dict.items():
        assert c_dict.get(key, '') == value