Skip to content

Commit 23488dd

Browse files
authored
test: check site project links against MANIFEST in CI (#129)
1 parent 3761c43 commit 23488dd

2 files changed

Lines changed: 21 additions & 28 deletions

File tree

‎scripts/check_site_content.sh‎

Lines changed: 0 additions & 28 deletions
This file was deleted.

‎tests/test_site.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import re
12
from pathlib import Path
23

4+
from brand.build import projects as p
5+
36
_INDEX = Path(__file__).parent.parent / "docs" / "index.md"
47

58

@@ -12,3 +15,21 @@ def test_home_page_supplies_its_own_h1() -> None:
1215
decoration — and the site quietly grows a "Modern Python" heading above it.
1316
"""
1417
assert "<h1" in _INDEX.read_text(encoding="utf-8")
18+
19+
20+
def test_every_listed_project_mark_has_a_site_entry() -> None:
21+
"""INVARIANT: the repos in the org site's project lists are exactly the repos in
22+
`projects.py::MANIFEST` minus the `modern-di-*` integrations.
23+
24+
It is the site's half of the profile-row invariant. A hand-kept list of expected
25+
repos drifts the same way the page does, so a repo added to the org and the profile
26+
can still be missing here without anything failing.
27+
"""
28+
listed = set(
29+
re.findall(
30+
r"^- \[`([^`]+)`\]\(https://github\.com/modern-python/\1\)",
31+
_INDEX.read_text(encoding="utf-8"),
32+
flags=re.M,
33+
)
34+
)
35+
assert listed == {repo for repo in p.MANIFEST if not repo.startswith("modern-di-")}

0 commit comments

Comments
 (0)