From 422de84ac8f6030c208dff5526b66a6daf4eb9d0 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 6 Nov 2026 03:51:54 +0100 Subject: [PATCH] chore: ask for the Lakka card in the platform menu The manual platform menu test expected /storage/system for Lakka on a computer. Lakka is a card setup now, so the menu finds its card's STORAGE part: the default-folder case uses RetroPie, and a Lakka case checks the card. --- tests/test_install.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/test_install.py b/tests/test_install.py index e51432718..f36389a1e 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -1863,12 +1863,28 @@ class TestManualPlatformPrompt(unittest.TestCase): self.assertEqual(chosen, [("batocera", Path("~/my bios").expanduser())]) def test_default_directory_comes_from_the_table(self): - answers = iter(["lakka", ""]) + answers = iter(["retropie", ""]) 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, [("lakka", install.DEFAULT_DESTS["lakka"])]) + self.assertEqual(chosen, [("retropie", install.DEFAULT_DESTS["retropie"])]) + + def test_lakka_on_a_computer_asks_for_its_card(self): + """/storage/system, a folder only the Lakka machine has, was taken + on a computer: Lakka keeps its BIOS on its card's STORAGE part.""" + card = Path(_tempdir(self)) + (card / ".config" / "retroarch").mkdir(parents=True) + (card / ".config" / "retroarch" / "retroarch.cfg").write_text( + 'system_directory = "/tmp/system"\n') + answers = iter(["lakka"]) + out = io.StringIO() + with unittest.mock.patch("builtins.input", lambda _prompt="": next(answers)), \ + unittest.mock.patch.object(install, "_mounted_cards", return_value=[card]), \ + contextlib.redirect_stdout(out): + chosen = install._prompt_manual_platform("linux") + self.assertEqual(chosen, [("lakka", card / "system")]) + self.assertIn("Lakka card found", out.getvalue()) def test_batocera_on_a_computer_gets_no_default(self): """/userdata/bios, a folder only the Batocera