fix: find generated pages through sitepages

test_release_packs looked for platforms/knulli.md, but the page is knulli.mdx, so test_a_built_setup_page_has_the_line always skipped, in CI too. Under the skip it asserted text the generator never writes: the glossary wraps ZIP in an <abbr>, and the heading is '## On the device { #install }', not '## Install'. It now reads the page through sitepages.page() after sitepages.require(), strips the glossary markup and looks for the #install heading. The single-page helpers of test_site_reference and test_site_emulators go through sitepages too, so a missing page fails in CI instead of skipping or reading as empty.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 06:04:40 +01:00
1 parent a58ca7bf6b
commit d73afff852
3 files changed
+14 -22

No files matched your search

+9 -6
View File
@@ -14,11 +14,13 @@ platform has a permanent page at get/<platform>/ instead.
from __future__ import annotations
import tests
from tests import sitepages
from tests.sources import script_source
import contextlib
import io
import json
import re
import sys
import tempfile
import unittest
@@ -270,13 +272,14 @@ class EverySurfaceSaysWhy(unittest.TestCase):
self.assertNotIn("yet", block)
def test_a_built_setup_page_has_the_line(self):
page = REPO_ROOT / "website" / "src" / "content" / "docs" / "platforms" / "knulli.md"
if not page.is_file():
self.skipTest("the site is not generated")
text = page.read_text(encoding="utf-8")
sitepages.require()
page = sitepages.page("platforms/knulli.md").read_text(encoding="utf-8")
# The glossary wraps the first ZIP of the page in an <abbr>.
text = re.sub(r"<abbr[^>]*>(.*?)</abbr>", r"\1", page)
self.assertIn("No ZIP for KNULLI. The command installs every file and checks it.", text)
install = text.index("## Install")
self.assertLess(install, text.index("No ZIP for KNULLI"))
install = re.search(r"(?m)^## (?:Install|.+ \{ #install \})$", text)
self.assertIsNotNone(install)
self.assertLess(install.start(), text.index("No ZIP for KNULLI"))
def test_get_your_files_explains_the_rows(self):
page = _which_pack()