mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-26 13:47:20 -05:00
feat: order system cards and show their facts
Required BIOS first with a Start with line by region, a fact grid with setup display names and a key, a link icon in place of the word permalink, a console table on the systems index.
This commit is contained in:
1 parent
2098b7a955
commit
7d0fc83206
4 files changed
+386
-113
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
@@ -354,15 +355,15 @@ class TheSearchSkipsLinkLists(unittest.TestCase):
|
||||
consumers.installed = {sha1: {"batocera": {"bios/a.bin"}}}
|
||||
consumers.emulators = {sha1: {"duckstation"}}
|
||||
entry = {"name": "a.bin", "sha1": sha1, "md5": "b" * 32, "size": 3}
|
||||
text = "\n".join(generate_site._system_file_card(entry, consumers))
|
||||
searched, _sep, skipped = text.partition("<section data-pagefind-ignore>")
|
||||
self.assertIn("<code>a.bin</code>", searched)
|
||||
self.assertNotIn("- MD5:", searched)
|
||||
for line in ("- MD5:", "- Emulators:", "- Also installed by:"):
|
||||
self.assertIn(line, skipped)
|
||||
lines = generate_site._system_file_card(entry, consumers)
|
||||
self.assertIn("<code>a.bin</code>", lines[2])
|
||||
rows = {re.search(r"<dt>(.*?)</dt>", line)[1]: line for line in lines
|
||||
if line.startswith("<div") and "<dt>" in line}
|
||||
for label in ("MD5", "Emulators", "Packed for its emulators by"):
|
||||
self.assertTrue(rows[label].startswith("<div data-pagefind-ignore>"), label)
|
||||
# The platforms line names the file as each setup does: the site
|
||||
# search reads it, so a file name finds its card.
|
||||
self.assertIn("- Platforms:", searched + skipped.split("</section>", 1)[1])
|
||||
self.assertTrue(rows["On the setup's list"].startswith("<div><dt>"))
|
||||
|
||||
def test_a_game_data_card_skips_its_name_too(self):
|
||||
import generate_site
|
||||
|
||||
Reference in new issue
Block a user