Пример #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")