INNER CODE UNIT · Python

test_invalid_fixture_rejected

onedr0p/cluster-template · template/scripts/test_validate.py:44

def test_invalid_fixture_rejected(fixture: Path):
    with pytest.raises(ConfigError):
        load(str(fixture))


def _load_raw(raw: dict) -> Config:
    try:
        return Config.model_validate(raw)
    except ValidationError as e:
        raise ConfigError(format_errors(e)) from None


def test_host_bits_error_suggests_network_address():
    raw = config_from("public.toml", **{"network.node_cidr": "10.10.10.5/24"})
    with pytest.raises(ConfigError, match=r"did you mean 10\.10\.10\.0/24"):
        _load_raw(raw)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…