mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-18 01:13:30 -05:00
fix: show where each platform file goes
This commit is contained in:
1 parent
de30a43441
commit
0cfaf06735
2 files changed
+23
-1
No files matched your search
@@ -1401,7 +1401,11 @@ def _render_platform_systems(
|
||||
if size_str:
|
||||
details.append(size_str)
|
||||
|
||||
lines.append(f"{pad}- `{fname}` - {', '.join(details)}")
|
||||
# Where the file goes, when its name alone does not say: three
|
||||
# GameCube IPL.bin differ only by GC/USA, GC/EUR and GC/JAP.
|
||||
destination = str(cfg_entry.get("destination") or "")
|
||||
where = f" at `{destination}`" if destination and destination != fname else ""
|
||||
lines.append(f"{pad}- `{fname}`{where} - {', '.join(details)}")
|
||||
# Show full hashes on a sub-line (useful for copy-paste)
|
||||
if sha1 or md5:
|
||||
hash_parts = []
|
||||
|
||||
@@ -312,5 +312,23 @@ class AnEmulatorPageNamesItsRevision(unittest.TestCase):
|
||||
page,
|
||||
)
|
||||
|
||||
|
||||
class APlatformPageSaysWhereEachFileGoes(unittest.TestCase):
|
||||
"""Three GameCube IPL.bin were listed by name alone: nothing told which
|
||||
goes to GC/USA, GC/EUR or GC/JAP."""
|
||||
|
||||
def test_same_named_files_show_their_destinations(self):
|
||||
import generate_site # noqa: PLC0415
|
||||
|
||||
regions = ("USA", "EUR", "JAP")
|
||||
declared = [{"name": "IPL.bin", "destination": f"dolphin-emu/Sys/GC/{r}/IPL.bin",
|
||||
"sha1": str(i) * 40} for i, r in enumerate(regions)]
|
||||
files = [{"name": "IPL.bin", "status": "ok"} for _ in regions]
|
||||
lines = generate_site._render_platform_systems(
|
||||
{"nintendo-gamecube": files}, {("nintendo-gamecube", "IPL.bin"): declared}, {})
|
||||
for region in regions:
|
||||
self.assertIn(f"- `IPL.bin` at `dolphin-emu/Sys/GC/{region}/IPL.bin` - OK",
|
||||
"\n".join(lines))
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user