def test_get_config_bad(bad_config): with pytest.raises(json.JSONDecodeError): config.get(".", bad_config)
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
def test_get_config_bad_user_config(): with pytest.raises(AssertionError): config.get("s", 1)
def test_get_config_fake_config_path(): with pytest.raises(FileNotFoundError): config.get("/", "/s/as/df/as/df")
def test_get_config_bad_source(): with pytest.raises(AssertionError): config.get(1, "s")