fix: link every platform's launcher citations

This commit is contained in:
Abdessamad Derraz committed 2026-11-05 11:45:24 +01:00
1 parent ba150de469
commit ecb56c43e5
3 files changed
+26 -13

No files matched your search

+20 -1
View File
@@ -129,13 +129,32 @@ class EvidenceLinksItsSource(unittest.TestCase):
evidence = {"read_by": [{"emulator": "launcher", "proof": "launcher",
"entries": [], "runs_system": True}]}
config = load_platform_config("batocera", PLATFORMS)
launched = generate_site._launcher_refs("batocera", config)["scph1001.bin"]
launched = generate_site._launcher_refs(config)["scph1001.bin"]
text = generate_site._category_evidence_md(evidence, launched)
self.assertNotIn("(by launcher)", text)
self.assertIn("https://github.com/batocera-linux/batocera.linux/blob/batocera-43.1/"
"package/batocera/core/batocera-configgen/", text)
self.assertIn("duckstationGenerator.py:115-136", text)
def test_every_platform_links_its_launchers(self):
"""Only Batocera and RetroBat were linked: Recalbox, ROCKNIX, EmuDeck,
RetroPie and RetroDECK read their launchers in the list's repository
too, and their citations came out as plain code."""
checked = 0
for path in sorted(Path(PLATFORMS).glob("*.yml")):
if not path.stem[0].isalpha():
continue
config = load_platform_config(path.stem, PLATFORMS)
if not config.get("launchers"):
continue
with self.subTest(platform=path.stem):
rendered = [text for texts in generate_site._launcher_refs(config).values()
for text in texts]
self.assertTrue(rendered)
self.assertFalse([t for t in rendered if " at `" in t])
checked += 1
self.assertGreaterEqual(checked, 7)
def test_a_launcher_in_another_repository_is_not_linked(self):
source = list_source("https://gitlab.com/recalbox/recalbox/-/raw/10.1.1/x/es_bios.xml")
self.assertEqual(launcher_ref_markdown(None, "a/b.py:3"), "`b.py:3`")