fix: give the bare platform menu its default

With nothing detected, the menu had no Enter default, while --help and
the --dest menu name RetroArch as the fallback. Its title now also says
why the question is asked.
This commit is contained in:
Abdessamad Derraz committed 2026-10-23 14:21:45 +02:00
1 parent 19b4ef5de4
commit 778d2d56e6
4 files changed
+14 -3

No files matched your search

+10
View File
@@ -1808,6 +1808,16 @@ class TestManualPlatformPrompt(unittest.TestCase):
chosen, [("retroarch", Path.home() / ".config" / "retroarch" / "system")]
)
def test_enter_takes_retroarch_as_the_dest_menu_does(self):
"""The --dest menu offered `[Enter for RetroArch]` and this one, the
same list, had no default."""
answers = iter(["", ""])
out = io.StringIO()
with unittest.mock.patch("builtins.input", lambda _prompt="": next(answers)), \
contextlib.redirect_stdout(out):
chosen = install._prompt_manual_platform("linux")
self.assertEqual(chosen[0][0], "retroarch")
def test_name_and_explicit_directory(self):
answers = iter(["batocera", "~/my bios"])
with unittest.mock.patch("builtins.input", lambda _prompt="": next(answers)):