mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-20 10:23:16 -05:00
fix: show a version per build as text
This commit is contained in:
1 parent
6490cc6613
commit
58a5783d14
2 files changed
+24
-2
No files matched your search
@@ -2893,8 +2893,14 @@ def generate_emulator_page(
|
||||
upstream_none = "upstream" in profile and upstream_raw is None
|
||||
upstream = str(upstream_raw) if isinstance(upstream_raw, str) else ""
|
||||
version_raw = profile.get("core_version", "unknown")
|
||||
version = "none published" if version_raw is None else version_raw
|
||||
profile.get("display_name", emu_name)
|
||||
if version_raw is None:
|
||||
version = "none published"
|
||||
elif isinstance(version_raw, dict):
|
||||
# Keyed by build mode like source: each build's version, named,
|
||||
# where the page printed the dict's Python repr.
|
||||
version = ", ".join(f"{v} ({mode})" for mode, v in version_raw.items() if v)
|
||||
else:
|
||||
version = version_raw
|
||||
profiled = profile.get("profiled_date", "unknown")
|
||||
systems = profile.get("systems", [])
|
||||
cores = profile.get("cores", [name])
|
||||
|
||||
@@ -516,5 +516,21 @@ class AnEmulatorPageLinksItsProfile(unittest.TestCase):
|
||||
self.assertIn("(../api/v1/emulators/raze.json)", page)
|
||||
|
||||
|
||||
class AVersionPerBuildReadsAsVersions(unittest.TestCase):
|
||||
"""MesenCE's page showed {'standalone': '2.2.1', 'libretro': '2.0.0'}."""
|
||||
|
||||
def test_each_build_is_named(self):
|
||||
from generate_site import generate_emulator_page # noqa: PLC0415
|
||||
|
||||
page = generate_emulator_page(
|
||||
"mesence",
|
||||
{"emulator": "MesenCE", "type": "standalone + libretro", "systems": [],
|
||||
"core_version": {"standalone": "2.2.1", "libretro": "2.0.0"}, "files": []},
|
||||
{"files": {}, "indexes": {}},
|
||||
)
|
||||
self.assertIn("2.2.1 (standalone), 2.0.0 (libretro)", page)
|
||||
self.assertNotIn("{'standalone'", page)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user