示例#1
0
def test_get_config_bad(bad_config):
    with pytest.raises(json.JSONDecodeError):
        config.get(".", bad_config)
示例#2
0
def test_get_config_real(good_config):
    dconfig = config.get(".", good_config)
    assert isinstance(dconfig, dict)
    assert "INPUT" in dconfig
    assert dconfig["INPUT"] == "."
    assert dconfig["TAB_SIZE"] == 69
示例#3
0
def test_get_config_bad_user_config():
    with pytest.raises(AssertionError):
        config.get("s", 1)
示例#4
0
def test_get_config_fake_config_path():
    with pytest.raises(FileNotFoundError):
        config.get("/", "/s/as/df/as/df")
示例#5
0
def test_get_config_bad_source():
    with pytest.raises(AssertionError):
        config.get(1, "s")