mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-24 10:37:54 -06:00
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:
1 parent
a58ca7bf6b
commit
d73afff852
3 files changed
+14
-22
No files matched your search
@@ -32,6 +32,7 @@ it has not been generated.
|
||||
from __future__ import annotations
|
||||
|
||||
import tests
|
||||
from tests import sitepages
|
||||
from tests.sources import script_source
|
||||
|
||||
import csv
|
||||
@@ -978,14 +979,6 @@ class SourceLinksGoWhereTheFileIs(unittest.TestCase):
|
||||
DOCS = REPO_ROOT / "website" / "src" / "content" / "docs"
|
||||
|
||||
|
||||
def _page(stem: str) -> str:
|
||||
for suffix in (".md", ".mdx"):
|
||||
path = DOCS / f"{stem}{suffix}"
|
||||
if path.is_file():
|
||||
return path.read_text(encoding="utf-8")
|
||||
raise unittest.SkipTest(f"{stem} not generated")
|
||||
|
||||
|
||||
class LookupRecordsUnderEveryHash(unittest.TestCase):
|
||||
"""8.1: a platform listing a file by MD5 is found by its SHA1 too."""
|
||||
|
||||
@@ -1274,7 +1267,8 @@ class NoEmptyCoreTable(unittest.TestCase):
|
||||
_built(DOCS / "cross-reference.md")
|
||||
for name in ("misterfpga", "bizhawk"):
|
||||
self.assertFalse((DOCS / f"cross-reference-{name}.md").exists())
|
||||
self.assertIn(platformpage.OWN_LIST_ONLY, _page(f"platforms/{name}"))
|
||||
page = sitepages.page(f"platforms/{name}.md").read_text(encoding="utf-8")
|
||||
self.assertIn(platformpage.OWN_LIST_ONLY, page)
|
||||
redirects = json.loads((REPO_ROOT / "website" / "src" / "generated" /
|
||||
"redirects.json").read_text())
|
||||
self.assertEqual(redirects.get("/cross-reference-misterfpga/"), "/platforms/misterfpga/")
|
||||
|
||||
Reference in new issue
Block a user