예제 #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")