fix: say what minui and file-less cores get

--list-platforms said the MinUI layout was not written yet while
--from-pack and --dest wrote it. On the device the card root is now
found and its version.txt names the file list, and a card without one
gets the --platform and --dest to use. A core with no file of its own
says its files are the platform's, always kept, instead of 0 files.
This commit is contained in:
Abdessamad Derraz committed 2026-10-23 14:08:28 +02:00
1 parent e041fac351
commit ebfa0cbb31
6 files changed
+106 -21

No files matched your search

+37
View File
@@ -9,6 +9,7 @@ to one answer.
from __future__ import annotations
import contextlib
import functools
import hashlib
import http.server
@@ -353,6 +354,42 @@ class CommandLineChoices(unittest.TestCase):
install.parse_selection(bad, 5)
class ACoreWithNoFileOfItsOwn(unittest.TestCase):
"""pcsx_rearmed, swanstation and pcsx1 showed `0 files, 0 B` in the
cores step and in --list-cores, which reads as "this core gets nothing":
their files are the platform's own, which are always kept."""
FILES = [
{"dest": "scph5501.bin", "size": 5, "cores": None, "systems": ["sony-playstation"],
"declared_choices": [], "slot_choices": [{"cores": ["pcsx_rearmed"]}]},
{"dest": "ps2.bin", "size": 9, "cores": ["duckstation"],
"systems": ["sony-playstation"]},
]
def _line(self, out: str, core: str) -> str:
return next(line for line in out.splitlines() if line.strip().startswith(core)
or f") {core}" in line)
def test_the_listing_says_its_files_are_the_platforms(self):
out = io.StringIO()
with contextlib.redirect_stdout(out):
install._print_choices("retroarch", self.FILES, [], systems=False)
line = self._line(out.getvalue(), "pcsx_rearmed")
self.assertNotIn("0 files", line)
self.assertIn("always kept", line)
self.assertIn("1 file, 9 B", self._line(out.getvalue(), "duckstation"))
def test_the_cores_step_says_so_too(self):
answers = iter(["c", "", ""])
out = io.StringIO()
with mock.patch("builtins.input", lambda _prompt="": next(answers)), \
contextlib.redirect_stdout(out):
install._prompt_custom_selection("retroarch", self.FILES, [])
line = self._line(out.getvalue(), "pcsx_rearmed")
self.assertNotIn("0 files", line)
self.assertIn("always kept", line)
class TheBoundaryChecksTheNewFields(unittest.TestCase):
def _manifest(self, **extra):
entry = {"dest": "a.bin", "sha1": "a" * 40, "size": 1,