Skip to content

Commit ad1402c

Browse files
stonebigclaude
andcommitted
Test: read the release title from site_content.toml
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 8b89bdb commit ad1402c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎tests/test_render_site.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import datetime
1414
import importlib.util
1515
import shutil
16+
import tomllib
1617
from pathlib import Path
1718

1819
import pytest
@@ -190,13 +191,15 @@ def test_a_release_lands_in_both_files(self, render, one_cycle, content, tmp_pat
190191
site = tmp_path / "site"
191192
shutil.copytree(SITE, site, ignore=shutil.ignore_patterns(".git"))
192193
before = (site / "releases.html").read_text(encoding="utf-8")
194+
newest = (site / "md5_sha1.txt").read_text(encoding="utf-8").lstrip().splitlines()[0]
195+
title = tomllib.loads(content.read_text(encoding="utf-8"))["release"]["title"]
193196

194197
render.main(["render_site.py", "--tag", "2026-04", "--hashes", str(one_cycle),
195198
"--site", str(site), "--content", str(content), "--date", "2026-09-06"])
196199

197200
md5 = (site / "md5_sha1.txt").read_text(encoding="utf-8")
198-
assert md5.lstrip().startswith("### WinPython 2026-03 (September 6th, 2026)")
199-
assert "### WinPython 2026-03 (August 22nd, 2026)" in md5, "history must survive"
201+
assert md5.lstrip().startswith(f"### {title} (September 6th, 2026)")
202+
assert newest in md5, "history must survive"
200203

201204
after = (site / "releases.html").read_text(encoding="utf-8")
202205
assert after.count("<details") == before.count("<details") + 1

0 commit comments

Comments
 (0)