mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-18 09:23:26 -05:00
fix: give the reason on an unsourceable card
This commit is contained in:
1 parent
6d67a56097
commit
c0e0da03a6
2 files changed
+24
No files matched your search
@@ -2304,6 +2304,13 @@ def _render_emulator_file(
|
||||
lines.append(f"- {d}")
|
||||
if fnote:
|
||||
lines.append(f"- {_escape_tags(str(fnote))}")
|
||||
if not in_repo and f.get("unsourceable"):
|
||||
# The badge alone sent readers after a dump that cannot exist; the
|
||||
# reason was only on the gaps page, which the card did not link.
|
||||
lines.append(
|
||||
f"- Not collectable: {_escape_tags(str(f['unsourceable']))} "
|
||||
"([acknowledged gaps](../gaps.md#acknowledged-gaps))"
|
||||
)
|
||||
if contents:
|
||||
# Every member with the hashes the emulator checks: MAME and FBNeo
|
||||
# verify the members, never the archive, so a member's crc32 is the
|
||||
|
||||
@@ -4498,5 +4498,22 @@ class GapsPageCountsOneWay(unittest.TestCase):
|
||||
self.assertEqual(result["settled_by"], "arcade")
|
||||
|
||||
|
||||
|
||||
class UnsourceableCardSaysWhy(unittest.TestCase):
|
||||
"""DraStic's nds_firmware_modified.bin carried an 'unsourceable' badge
|
||||
and nothing else; the reason was only on the gaps page."""
|
||||
|
||||
def test_reason_and_link(self):
|
||||
from scripts.generate_site import _render_emulator_file
|
||||
|
||||
entry = {"name": "nds_firmware_modified.bin", "path": "x.bin",
|
||||
"unsourceable": "written by the firmware editor, so no dump of it exists"}
|
||||
text = "\n".join(_render_emulator_file(
|
||||
entry, {"files": [entry]}, None, [entry], lambda f: False, "file-x",
|
||||
))
|
||||
self.assertIn("Not collectable: written by the firmware editor", text)
|
||||
self.assertIn("../gaps.md#acknowledged-gaps", text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user