fix: additions join the native id their cores read

A platform system spanning several native ids with no native_id filed every addition under the id that sorts first: RetroDECK's arcade wrote MAME device archives as FBNeo BIOS, RetroBat's Amiga put A500 kickstarts under amiga1200. An addition now joins the id whose declared files its cores read, and one the cores do not settle is counted and not written.
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 03:57:39 +01:00
1 parent 7d2c393118
commit d5e61308e1
3 files changed
+56 -6

No files matched your search

+22
View File
@@ -499,6 +499,28 @@ class Reconciliation(unittest.TestCase):
systems, _ = build_native_model({"systems": {}}, scraped)
self.assertEqual(sorted(systems), ["pcengine", "supergrafx"])
def test_an_addition_joins_the_native_id_its_cores_read(self):
"""RetroDECK's arcade spans mame and fbneo with no primary id. Every
addition went under fbneo, the first sorted, MAME device archives
included. One the cores do not settle is not written."""
scraped = {"systems": {"arcade": {"files": [
{"name": "neogeo.zip", "destination": "neogeo.zip", "native_system": "mame"},
{"name": "pgm.zip", "destination": "pgm.zip", "native_system": "fbneo"},
]}}}
truth = {"systems": {"arcade": {"files": [
{"name": "neogeo.zip", "_cores": ["mame"]},
{"name": "pgm.zip", "_cores": ["fbneo"]},
{"name": "a2autokbd.zip", "_cores": ["mame"]},
{"name": "dkong.zip", "_cores": ["mame", "fbneo"]},
]}}}
systems, report = build_native_model(truth, scraped)
self.assertEqual(
[fe.name for fe in systems["mame"].files if fe.platform is None],
["a2autokbd.zip"],
)
self.assertFalse([fe for fe in systems["fbneo"].files if fe.platform is None])
self.assertEqual(report.unattributed, ["arcade/dkong.zip"])
def test_an_entry_the_platform_declares_without_a_hash_is_still_written(self):
"""Batocera and RetroBat both ship entries with an empty md5."""
scraped = {