refactor: read the clone map in one place

This commit is contained in:
Abdessamad Derraz committed 2026-11-22 02:26:45 +01:00
1 parent 758bc76b6f
commit 12c8d66163
5 files changed
+66 -45

No files matched your search

+1 -1
View File
@@ -48,7 +48,7 @@ COMMANDS = {
"region_audit.py": ("resolve/regionaudit.py",),
"dedup.py": (
"model/nodedup.py", "collection/dedup.py", "collection/duplicates.py",
"collection/clonemap.py",
"collection/clonemap.py", "model/database.py",
),
"release_record.py": ("model/releaserecord.py", "release/record.py"),
"release_notes.py": ("release/notes.py",),
+14
View File
@@ -3831,6 +3831,20 @@ class GeneratedModelsAreWrittenWhole(unittest.TestCase):
# Stopped before removing anything.
self.assertTrue((bios / "Arcade" / "MAME" / "setclone.zip").exists())
def test_the_pack_side_reads_the_same_bad_map_the_same_way(self):
from model import database
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
(root / "bios").mkdir()
(root / "_mame_clones.json").write_text("<<<<<<< HEAD")
with self.assertRaises(database.CloneMapUnreadable) as caught:
database.get_mame_clone_map(str(root / "bios"))
self.assertIn("Restore it from git", str(caught.exception))
(root / "_mame_clones.json").write_text("[]")
with self.assertRaises(database.CloneMapUnreadable):
database.get_mame_clone_map(str(root / "bios"))
class APackNoteBesideItsSlotIsANote(unittest.TestCase):
"""The builder writes INSTRUCTIONS_<name>.txt beside the slot it