From d2d88cf6b8b3f81db9fd7e2de801bd1ebb430114 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 6 Oct 2026 01:33:58 +0200 Subject: [PATCH] fix: send retropie users to the retropie pack --- scripts/generate_site.py | 2 +- tests/test_which_pack.py | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 tests/test_which_pack.py diff --git a/scripts/generate_site.py b/scripts/generate_site.py index 1f038231..436cf701 100644 --- a/scripts/generate_site.py +++ b/scripts/generate_site.py @@ -3463,7 +3463,7 @@ open them depends on their name: | Setup | What it is | Pack | Extract to | |-------|-----------|------|-----------| -| [RetroPie](https://retropie.org.uk/) | The classic Pi emulation setup, largest community, most online guides | [RetroArch]({rel}) | `~/RetroPie/BIOS/` | +| [RetroPie](https://retropie.org.uk/) | The classic Pi emulation setup, largest community, most online guides | [RetroPie]({rel}) | `~/RetroPie/BIOS/` | | [Lakka](https://www.lakka.tv/) | Lightweight RetroArch OS, minimal config, boots straight into the UI | [RetroArch]({rel}) | `/storage/system/` | | [Batocera](https://batocera.org/) | Easy setup, works on Pi 3/4/5 and many other boards (Odroid, etc.) | [Batocera]({rel}) | `/userdata/bios/` | | [Recalbox](https://www.recalbox.com/) | Plug-and-play experience, good for a first build | [Recalbox]({rel}) | `/recalbox/share/bios/` | diff --git a/tests/test_which_pack.py b/tests/test_which_pack.py new file mode 100644 index 00000000..3a8d919e --- /dev/null +++ b/tests/test_which_pack.py @@ -0,0 +1,50 @@ +"""The "which pack" table sends each platform to the pack built for it. + +RetroPie's row linked the RetroArch pack, although a RetroPie pack is +published and carries 3916 files the RetroArch one does not. +""" + +from __future__ import annotations + +import re +import sys +import unittest +from pathlib import Path + +REPO_ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(REPO_ROOT / "scripts")) + + +class WhichPackRows(unittest.TestCase): + def test_platform_rows_name_their_own_pack(self): + from common import ( + group_identical_platforms, + list_registered_platforms, + load_platform_config, + ) + + platforms_dir = str(REPO_ROOT / "platforms") + registered = list_registered_platforms(platforms_dir, include_archived=True) + display = { + p: load_platform_config(p, platforms_dir).get("platform", p) + for p in registered + } + packs_of: dict[str, set[str]] = {} + for group, _rep in group_identical_platforms(registered, platforms_dir): + names = {display[p] for p in group} + for p in group: + packs_of[display[p]] = names + source = (REPO_ROOT / "scripts" / "generate_site.py").read_text(encoding="utf-8") + row = re.compile(r"^\| \[([^\]]+)\]\([^)]*\) \|[^|]*\| \[([^\]]+)\]\(\{rel\}\)", re.M) + checked = 0 + for setup, pack in row.findall(source): + if setup not in packs_of: + continue + checked += 1 + with self.subTest(setup=setup): + self.assertIn(pack, packs_of[setup]) + self.assertGreater(checked, 5) + + +if __name__ == "__main__": + unittest.main()