fix: record no narrowing axis for an older list

A list with cores and neither systems nor regions is from an older
release, and recorded_axes reads none from it. A pack built here or by
generate_pack wrote cores and regions in its manifest. The installer
pack now asks recorded_axes, and the builder follows the same rule.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 06:04:39 +01:00
1 parent 7284a90a20
commit b338d94fa0
7 files changed
+53 -33

No files matched your search

+27
View File
@@ -637,5 +637,32 @@ class PartSizes(unittest.TestCase):
install.parse_part_size(text)
class AListRecordsWhatItNarrowsBy(unittest.TestCase):
"""A pack built here, a pack built by generate_pack and the list itself
agree on what --system, --core and --region narrow. A list with cores
and neither systems nor regions, from an older release, records none:
the packs said cores and regions."""
SHAPES = (
[{"dest": "a.bin", "cores": ["mgba"]}],
[{"dest": "a.bin", "cores": ["mgba"], "regions": ["usa"]}],
[{"dest": "a.bin", "cores": None, "systems": ["nintendo-gba"]}],
[{"dest": "a.bin", "cores": None, "systems": [],
"slot_choices": [{"sha1": "0" * 40, "cores": ["mgba"]}]}],
)
def test_each_shape(self):
from packs.scope import pack_systems
for files in self.SHAPES:
listing = {"files": files, "omitted_files": []}
with self.subTest(files=files):
axes = sorted(install.recorded_axes(files))
built = json.loads(install.pack_manifest("retroarch", listing, [], None))
self.assertEqual(built["list_records"], axes)
self.assertEqual(pack_systems(listing)["list_records"], axes)
if __name__ == "__main__":
unittest.main()