feat: one card list and one card check

Every system that runs from its SD card comes from card_setups(),
derived from the device rules: the setup list, its filter, --platform
and the line menus give each its own row and ask for its card. The
RetroArch row no longer lists handheld systems.

card_root_folder and card_choice share one identity check: another
system's card is refused for every system, KNULLI and ROCKNIX included,
and the same --dest gives the same folder from every entry point. WSL
drive letters are read as typed, the line question lists only that
system's cards and asks again after no.

Offline at a terminal, files left out count as missing: the run ends
with code 1 or 2, as the full screen does. Continue on the systems list
opens Confirm. Wording and layout points of code_audit_13 and
tui_audit_6.
This commit is contained in:
Abdessamad Derraz committed 2026-10-27 02:55:29 +01:00
1 parent 55becb8aa4
commit d1d88fed27
26 files changed
+1555 -506

No files matched your search

+18 -1
View File
@@ -4230,10 +4230,27 @@ class DestAloneFollowsWhatIsFoundHere(unittest.TestCase):
unittest.mock.patch("builtins.input", lambda _prompt="": answer), \
contextlib.redirect_stdout(out), contextlib.redirect_stderr(out):
try:
return install._platform_for_dest("linux", Path("/media/card"), interactive), out.getvalue()
plat, folder = install._platform_for_dest("linux", Path("/media/card"),
interactive)
self.assertEqual(folder, Path("/media/card"))
return plat, out.getvalue()
except SystemExit as exc:
return exc, out.getvalue()
def test_a_card_system_chosen_checks_the_folder(self):
"""code_audit_13 P2-3: the menu offered no card system, and one
chosen now reads --dest as --platform does."""
root = Path(_tempdir(self))
answers = iter(["Onion", "retroarch"])
out = io.StringIO()
with unittest.mock.patch.object(install, "detect_platforms", return_value=[]), \
unittest.mock.patch("builtins.input", lambda _prompt="": next(answers)), \
contextlib.redirect_stdout(out):
plat, folder = install._platform_for_dest("linux", root, True)
self.assertEqual((plat, folder), ("retroarch", root))
self.assertIn(f"{root} is not an Onion SD card", out.getvalue())
self.assertIn("Onion, SD card (RetroArch files)", out.getvalue())
def test_nothing_found_is_retroarch_said_aloud(self):
plat, out = self._pick([])
self.assertEqual(plat, "retroarch")