Esempio n. 1
0
def test_mapping_list_config_file(option, value, expect):
    config = Config(env_prefix="ARCHIVEMATICA_DASHBOARD", attrs=CONFIG_MAPPING)
    config.read_defaults(
        StringIO.StringIO("[Dashboard]\n"
                          "{option} = {value}".format(option=option,
                                                      value=value)))
    if isinstance(expect, list):
        assert sorted(config.get("search_enabled")) == sorted(expect)
    else:
        with pytest.raises(expect):
            config.get("search_enabled")
Esempio n. 2
0
def test_mapping_list_config_file(option, value, expect):
    config = Config(env_prefix='ARCHIVEMATICA_DASHBOARD', attrs=CONFIG_MAPPING)
    config.read_defaults(StringIO.StringIO(
        '[Dashboard]\n'
        '{option} = {value}'.format(option=option, value=value)))
    assert config.get('search_enabled') is expect