mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-23 20:29:06 -05:00
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:
1 parent
e041fac351
commit
ebfa0cbb31
6 files changed
+106
-21
No files matched your search
@@ -4727,8 +4727,28 @@ class HandheldSystemsByTheirOwnFiles(unittest.TestCase):
|
||||
{"/usr/trimui/": "", "/mnt/SDCARD/.system/res/": ""})
|
||||
self.assertEqual(found, [])
|
||||
self.assertIn("MinUI found here", err)
|
||||
self.assertIn("--platform minui", err)
|
||||
self.assertIn("--dest", err)
|
||||
self.assertNotIn("TrimUI", err)
|
||||
|
||||
def test_a_minui_card_on_its_device_gets_its_file_list(self):
|
||||
"""--list-platforms said the MinUI layout was not written yet, while
|
||||
--from-pack and --dest wrote it: on the device the card root is the
|
||||
folder, and the card's version.txt names which of the three it is."""
|
||||
for release, plat, shown in (("MinUI-20251127-0", "minui", "MinUI"),
|
||||
("NextUI-20250601-1", "nextui", "NextUI"),
|
||||
("MyMinUI-20260809b-0", "myminui", "MyMinUI")):
|
||||
with self.subTest(release=release):
|
||||
root, found, name = self._one({
|
||||
"/usr/trimui/": "", "/mnt/SDCARD/.system/res/": "",
|
||||
"/mnt/SDCARD/.system/version.txt": release + "\n"})
|
||||
self.assertEqual((found, name), ((plat, root / "mnt/SDCARD"), shown))
|
||||
|
||||
def test_the_listing_says_what_the_minui_family_gets(self):
|
||||
line = next(line for line in install._system_lines() if line.startswith("MinUI:"))
|
||||
self.assertNotIn("does not write", line)
|
||||
self.assertIn("minui, nextui or myminui", line)
|
||||
|
||||
def test_two_unrelated_systems_are_refused(self):
|
||||
_root, found, names, _err = self._found(
|
||||
{"/mnt/SDCARD/Koriki/version.txt": "1\n"}, 'OS_NAME="JELOS"\n')
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user