fix: keep the bizhawk get title unique

This commit is contained in:
Abdessamad Derraz committed 2026-10-24 00:54:00 +02:00
1 parent 00649d0377
commit 33c2c64c0c
3 files changed
+14 -5

No files matched your search

+6 -2
View File
@@ -722,8 +722,12 @@ def get_page_link(platform_name: str, prefix: str = "") -> str:
def get_page_title(platform_name: str, display: str) -> str:
"""What a get/ page holds, by its name: the ZIP of a setup a release
publishes one for, the files of any other. "Download KNULLI" read as
the system's own download."""
return f"{display} BIOS pack" if has_release_pack(platform_name) else f"{display} BIOS files"
the system's own download. A setup that is also an emulator (BizHawk)
names it last: "BizHawk BIOS files" is the title of its emulator page."""
kind = "BIOS pack" if has_release_pack(platform_name) else "BIOS files"
if (_REPO_ROOT / "emulators" / f"{platform_name}.yml").is_file():
return f"{kind} for {display}"
return f"{display} {kind}"
def _unzip_into(platform_name: str, display: str, extract_to: str | None, parts: int) -> list[str]:
+1 -1
View File
@@ -314,7 +314,7 @@ class EveryPlatformHasAPermanentPage(unittest.TestCase):
page = generate_site.generate_get_page(name)
pack = release_record.pack_for(name, record)
with self.subTest(platform=name):
self.assertRegex(page, r"\n# .+ BIOS (pack|files)\n")
self.assertRegex(page, r"\n# (.+ )?BIOS (pack|files)( for .+)?\n")
if name in RELEASED and pack:
for asset in pack["assets"]:
self.assertIn(
+7 -2
View File
@@ -171,8 +171,12 @@ class GetPagesSayWhatTheyHold(unittest.TestCase):
display = _display(name)
text = sitepages.page(f"get/{name}.md").read_text(encoding="utf-8")
kind = "pack" if REGISTRY[name].get("release_pack") is True else "files"
title = (f"BIOS {kind} for {display}"
if (REPO_ROOT / "emulators" / f"{name}.yml").is_file()
else f"{display} BIOS {kind}")
with self.subTest(setup=name):
self.assertIn(f"title: {display} BIOS {kind}\n", text)
self.assertEqual(generate_site.get_page_title(name, display), title)
self.assertIn(f"title: {title}\n", text)
self.assertNotIn("Download ", text.split("\n---\n", 1)[0].split("title:", 1)[1]
.split("\n", 1)[0])
self.assertIn(f"link: /platforms/{name}/", text)
@@ -185,7 +189,8 @@ class GetPagesSayWhatTheyHold(unittest.TestCase):
if REGISTRY[name].get("release_pack") is True:
continue
with self.subTest(setup=name):
self.assertIn(f"Link to share: [{_display(name)} BIOS files](/retrobios/get/{name}/)",
title = generate_site.get_page_title(name, _display(name))
self.assertIn(f"Link to share: [{title}](/retrobios/get/{name}/)",
_page(f"platforms/{name}.md"))
def test_a_relative_folder_is_named_as_the_setups(self):