Support validated legacy portfolio composition
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Jens
2026-07-30 03:03:26 +02:00
parent f55668fb4b
commit f7e12230cf
2 changed files with 32 additions and 7 deletions
@@ -36,3 +36,18 @@ def test_combine_specs_rejects_mismatched_resolution(tmp_path: Path) -> None:
def test_combine_specs_rejects_incomplete_source(tmp_path: Path) -> None:
with pytest.raises(ValueError, match="not complete"):
combine_specs([write_spec(tmp_path / "one.json", "one", status="in_progress")])
def test_combine_specs_accepts_populated_legacy_v1_when_dimensions_come_from_complete_spec(tmp_path: Path) -> None:
legacy = tmp_path / "legacy.json"
legacy.write_text(json.dumps({"schema_version": 1, "samples": [{"sample_slug": "legacy"}]}), encoding="utf-8")
payload = combine_specs([legacy, write_spec(tmp_path / "current.json", "current")])
assert payload["sample_count"] == 2
assert payload["source_specs"][0]["source_status"] == "legacy_unstated"
def test_combine_specs_rejects_empty_legacy_v1(tmp_path: Path) -> None:
legacy = tmp_path / "legacy.json"
legacy.write_text(json.dumps({"schema_version": 1, "samples": []}), encoding="utf-8")
with pytest.raises(ValueError, match="not complete"):
combine_specs([legacy, write_spec(tmp_path / "current.json", "current")])