mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-27 03:48:52 -06:00
refactor: read target overrides through one reader
This commit is contained in:
1 parent
812f2609db
commit
35f335d001
7 files changed
+97
-70
No files matched your search
@@ -272,7 +272,7 @@ class CoreResolutionTests(unittest.TestCase):
|
||||
}
|
||||
}
|
||||
self.assertEqual(
|
||||
cf.unresolved_target_cores(targets, index, cf._platform_overrides(overrides, "plat")),
|
||||
cf.unresolved_target_cores(targets, index, cf.platform_overrides(overrides, "plat")),
|
||||
{"ghost": ["x86_64"]},
|
||||
)
|
||||
|
||||
|
||||
@@ -625,7 +625,7 @@ class EveryTargetCoreReachesAProfile(unittest.TestCase):
|
||||
continue
|
||||
unresolved = check_freshness.unresolved_target_cores(
|
||||
yaml.safe_load(Path(path).read_text()), index,
|
||||
check_freshness._platform_overrides(overrides, platform),
|
||||
check_freshness.platform_overrides(overrides, platform),
|
||||
)
|
||||
with self.subTest(platform=platform):
|
||||
if platform == "retropie":
|
||||
|
||||
@@ -241,5 +241,31 @@ class PublishedListsAreNotNarrowed(unittest.TestCase):
|
||||
self.assertEqual(data["regions"], [])
|
||||
|
||||
|
||||
class AnEmptyOverrideIsNoOverride(unittest.TestCase):
|
||||
"""`batocera:` or `board:` with no value raised AttributeError in the
|
||||
builder and the installer lists, where check_freshness read it as none."""
|
||||
|
||||
def test_every_reader_takes_an_empty_value(self):
|
||||
from model.targets import list_available_targets, load_target_config
|
||||
from packs.targets import target_list
|
||||
|
||||
with tempfile.TemporaryDirectory(dir=REPO_ROOT / "tmp") as tmp:
|
||||
targets = Path(tmp) / "targets"
|
||||
targets.mkdir()
|
||||
for platform in ("p", "q"):
|
||||
(targets / f"{platform}.yml").write_text(
|
||||
"targets:\n board:\n cores: [a]\n", encoding="utf-8"
|
||||
)
|
||||
(targets / "_overrides.yml").write_text(
|
||||
"p:\nq:\n targets:\n board:\n", encoding="utf-8"
|
||||
)
|
||||
for platform in ("p", "q"):
|
||||
with self.subTest(platform=platform):
|
||||
self.assertEqual(load_target_config(platform, "board", tmp), {"a"})
|
||||
self.assertEqual(list_available_targets(platform, tmp)[0]["aliases"], [])
|
||||
self.assertEqual(target_list(targets / f"{platform}.yml"), {"board": ["a"]})
|
||||
self.assertEqual(canonical_target_name(["p", "q"], "board", tmp), "board")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user