mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-26 21:57:24 -05:00
fix: compare a card's BIOS folder by folders
--dest NOTMUOS/bios ended with MUOS/bios as text and passed as a muOS card's folder. A card two systems claim now says so in one line, and the system named among them decides the folder.
This commit is contained in:
1 parent
246b6c6efc
commit
ccc8af7a47
4 files changed
+58
-8
No files matched your search
@@ -10,6 +10,7 @@ installs it).
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import contextlib
|
||||
import errno
|
||||
import fcntl
|
||||
import functools
|
||||
@@ -2122,6 +2123,33 @@ class AuditRoundThree(unittest.TestCase):
|
||||
self.assertEqual(install.card_dest("retroarch", "retroarch", root),
|
||||
("retroarch", root))
|
||||
|
||||
def test_p1_1_the_folder_named_is_compared_by_folders(self):
|
||||
"""NOTMUOS/bios ended with MUOS/bios as text and was taken for a
|
||||
muOS card's folder."""
|
||||
root = self.card({"roms/": ""})
|
||||
stray = root / "NOTMUOS" / "bios"
|
||||
with self.assertRaises(SystemExit), \
|
||||
contextlib.redirect_stderr(io.StringIO()) as err:
|
||||
install.card_dest("muos", "retroarch", stray)
|
||||
self.assertIn("is not a muOS card", err.getvalue())
|
||||
self.assertEqual(install.card_dest("muos", "retroarch", root / "muos" / "BIOS"),
|
||||
("retroarch", root / "muos" / "BIOS"))
|
||||
|
||||
def test_p1_1_a_card_two_systems_claim_says_so(self):
|
||||
root = self.card({"MUOS/": "", "spruce/": ""})
|
||||
self.assertIsNone(install.card_system(root))
|
||||
with contextlib.redirect_stdout(io.StringIO()) as out:
|
||||
self.assertEqual(install.card_dest("retroarch", "retroarch", root),
|
||||
("retroarch", root))
|
||||
lines = out.getvalue().splitlines()
|
||||
self.assertEqual(len(lines), 1, lines)
|
||||
self.assertIn("holds the files of muOS and spruceOS", lines[0])
|
||||
# The system named among them decides.
|
||||
with contextlib.redirect_stdout(io.StringIO()) as out:
|
||||
self.assertEqual(install.card_dest("muos", "retroarch", root),
|
||||
("retroarch", root / "MUOS/bios"))
|
||||
self.assertIn("muOS card", out.getvalue())
|
||||
|
||||
# P1-2: Space is X on PortMaster and Y on muxterm.
|
||||
|
||||
def test_p1_2_space_on_install_opens_the_confirm_screen(self):
|
||||
|
||||
Reference in new issue
Block a user