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

+2 -7
View File
@@ -28,6 +28,7 @@ Linux, Windows and Android commands, for MAME4droid an Android-only app.
from __future__ import annotations
import tests
from tests import sitepages
import re
import unittest
@@ -566,11 +567,7 @@ def _profiles_with_data_root() -> dict[str, dict]:
def _built_page(name: str) -> str:
for suffix in (".mdx", ".md"):
path = EMULATORS / f"{name}{suffix}"
if path.exists():
return path.read_text(encoding="utf-8")
return ""
return sitepages.page(f"emulators/{name}.md").read_text(encoding="utf-8")
def _generated() -> bool:
@@ -816,8 +813,6 @@ class AnEmulatorPageNamesItsSetups(unittest.TestCase):
self.assertEqual(emulatorcards.emulator_setups(coverages, profiles)["handy"], ["a", "b"])
def test_the_page_names_them(self):
from tests import sitepages
sitepages.require()
text = sitepages.page("emulators/handy.md").read_text(encoding="utf-8")
row = next(line for line in text.splitlines() if line.startswith("| Run by |"))