fix: one setup decision for line mode and screen

Line mode finds mounted cards, shows its menu and names the folder for a
pack, asks the folder instead of taking a default, and lists setups in the
screen's order. Devices have one spelling each, matched without case,
spaces or punctuation, and a device several systems run lists them all.
--tui --dest reads a card as --plain does. Card boundaries read every
parent up to a mount point from mountinfo. --offline with --yes counts the
files it leaves out as pending, never as failed. The P3 points of
code_audit_15 and tui_audit_8 follow.
This commit is contained in:
Abdessamad Derraz committed 2026-10-27 08:43:08 +01:00
1 parent 5431a42e23
commit 4fbbd2c760
18 files changed
+1413 -383

No files matched your search

+18 -3
View File
@@ -1829,10 +1829,25 @@ class TestManualPlatformPrompt(unittest.TestCase):
self.assertEqual(chosen, [("batocera", Path("~/my bios").expanduser())])
def test_default_directory_comes_from_the_table(self):
answers = iter(["batocera", ""])
with unittest.mock.patch("builtins.input", lambda _prompt="": next(answers)):
answers = iter(["lakka", ""])
with unittest.mock.patch("builtins.input", lambda _prompt="": next(answers)), \
unittest.mock.patch.object(install, "_mounted_cards", return_value=[]), \
contextlib.redirect_stdout(io.StringIO()):
chosen = install._prompt_manual_platform("linux")
self.assertEqual(chosen, [("batocera", install.DEFAULT_DESTS["batocera"])])
self.assertEqual(chosen, [("lakka", install.DEFAULT_DESTS["lakka"])])
def test_batocera_on_a_computer_gets_no_default(self):
"""tui_audit_8 P2-4: /userdata/bios, a folder only the Batocera
machine has, was offered on a computer, and Enter took it."""
answers = iter(["batocera", "", "~/share/bios"])
out = io.StringIO()
with unittest.mock.patch("builtins.input", lambda _prompt="": next(answers)), \
unittest.mock.patch.object(install, "_mounted_cards", return_value=[]), \
contextlib.redirect_stdout(out):
chosen = install._prompt_manual_platform("linux")
self.assertEqual(chosen, [("batocera", Path("~/share/bios").expanduser())])
self.assertIn("SHARE drive", out.getvalue())
self.assertNotIn("/userdata/bios", out.getvalue())
def test_quit_stops_like_ctrl_c(self):
"""`install.sh && retroarch` went on to start RetroArch with no BIOS