fix: write romm keys with a bare file name

RomM lists the platform firmware folder without recursing and looks each file up as slug:file_name (models/firmware.py, base_handler.list_files at 5.4.0). An addition named with a directory (fuse/48.rom) is not written.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 09:51:32 +02:00
1 parent 4205bc2233
commit 5ec1208a83
2 files changed
+43 -12

No files matched your search

+22
View File
@@ -622,6 +622,28 @@ class RommWritesOneEntryPerKey(unittest.TestCase):
)
class RommKeysHoldABareFileName(unittest.TestCase):
"""fuse declares fuse/48.rom: the export wrote zxs:fuse/48.rom, a key
RomM never looks up, since it lists the platform folder without
recursing and looks each file up as slug:file_name."""
def test_an_addition_named_with_a_directory_is_not_written(self):
nested = NativeFile("fuse/48.rom", "fuse/48.rom", "zxs",
truth={"size": 16384, "md5": A})
bare = NativeFile("plus2.rom", "plus2.rom", "zxs",
truth={"size": 32768, "md5": B})
exporter = Romm()
produced = exporter.render(
{"zxs": NativeSystem("zxs", files=[nested, bare])}, None, {}, None
)
self.assertEqual(
list(json.loads(produced[exporter.native_filename()])), ["zxs:plus2.rom"]
)
self.assertEqual(
[exporter.writable(nested), exporter.writable(bare)], [False, True]
)
class RetroPieProposals(unittest.TestCase):
def test_required_is_read_for_the_package_core(self):
fe = NativeFile("scph5501.bin", "scph5501.bin", "psx",