main
py 39 lines 1.74 KB
Raw
1 from pathlib import Path
2
3 ROOT = Path(__file__).resolve().parents[1]
4
5
6 def test_weekly_article_footer_has_prefilled_correction_report_link() -> None:
7 footer = (ROOT / "layouts/partials/article-footer.html").read_text(encoding="utf-8")
8
9 assert "Correction report: %s" in footer
10 assert "Article: %s" in footer
11 assert "Week: %s" in footer
12 assert "issues/new?title=%s&body=%s&labels=%s" in footer
13 assert "correction,reader-report" in footer
14 assert "Suggested labels for maintainers" in footer
15 assert "report a correction, source concern, or safety concern" in footer
16
17
18 def test_methodology_page_documents_corrections_and_responsible_ai_limits() -> None:
19 methodology = (ROOT / "content/methodology/_index.md").read_text(encoding="utf-8")
20
21 assert "## Responsible-AI caveats and bias limits" in methodology
22 assert "**Source bias:**" in methodology
23 assert "**English-language source bias:**" in methodology
24 assert "**Platform bias:**" in methodology
25 assert "not be read as a neutral or complete map" in methodology
26 assert "## Corrections and reader reports" in methodology
27 assert "Leave visible correction notes" in methodology
28 assert "`errata` entry" in methodology
29
30
31 def test_methodology_is_in_navigation_and_distribution_guidance() -> None:
32 hugo_config = (ROOT / "hugo.toml").read_text(encoding="utf-8")
33 distribution = (ROOT / "docs/growth/distribution-strategy.md").read_text(encoding="utf-8")
34
35 assert "identifier = 'methodology'" in hugo_config
36 assert "url = '/methodology/'" in hugo_config
37 assert "Methodology and corrections policy" in distribution
38 assert "https://www.claracle.com/methodology/" in distribution
39 assert "Do not promote an article as neutral or comprehensive" in distribution