예제 #1
0
def test_load_conf(conf):
    inconf = config.conf.copy()
    expected = inconf.copy()
    with temp_conf(conf) as fn:
        config.load_conf(fn)
        expected.update(conf)
        assert config.conf == expected
        config.reset_conf()
        assert config.conf == inconf
예제 #2
0
def test_load_conf(conf):
    # This test will only work if your config is set to default
    inconf = config.defaults.copy()
    expected = inconf.copy()
    with temp_conf(conf) as fn:
        config.load_conf(fn)
        expected.update(conf)
        assert config.conf == expected
        config.reset_conf()
        assert config.conf == inconf
예제 #3
0
def tmp_config_path(tmp_path):
    key = 'INTAKE_CONF_FILE'
    original = os.getenv(key)
    temp_config_path = os.path.join(tmp_path, 'test_config.yml')
    os.environ[key] = temp_config_path
    assert config.cfile() == temp_config_path
    yield temp_config_path
    config.reset_conf()
    if original:
        os.environ[key] = original
    else:
        del os.environ[key]
    assert config.cfile() != temp_config_path
예제 #4
0
def conf_reset_save(args):
    from intake.config import reset_conf, save_conf
    reset_conf()
    save_conf()
예제 #5
0
파일: config.py 프로젝트: zillow/intake
 def _reset(self, args):
     from intake.config import reset_conf, save_conf
     reset_conf()
     save_conf()