fix: count mister corrections only where it writes

This commit is contained in:
Abdessamad Derraz committed 2026-10-06 09:41:53 +02:00
1 parent 44cf638e06
commit ced7588d17
2 files changed
+26 -1

No files matched your search

+16
View File
@@ -181,6 +181,22 @@ class BizHawkCountsWhatItWrites(unittest.TestCase):
self.assertFalse(exporter.states(first, "sha1"))
class MisterCountsWhatItWrites(unittest.TestCase):
def test_a_path_the_database_lacks_is_not_counted(self):
from exporter.misterfpga_exporter import Exporter as Mister
held = NativeFile("boot.rom", "NES/boot.rom", "nes", platform={"md5": A},
truth={"md5": B}, corrections=["md5"])
absent = NativeFile("boot.rom", "SNES/boot.rom", "snes", platform={"md5": A},
truth={"md5": C}, corrections=["md5"])
systems = {"nes": NativeSystem("nes", files=[held]), "snes": NativeSystem("snes", files=[absent])}
database = {"db_id": "x", "files": {"games/NES/boot.rom": {"hash": A, "url": "u"}}}
exporter = Mister()
exporter.render(systems, None, {"bios_db.json": json.dumps(database)})
self.assertTrue(exporter.states(held, "md5"))
self.assertFalse(exporter.states(absent, "md5"))
class ModelKeepsOneFileOneEntry(unittest.TestCase):
def test_size_describes_the_hash_written(self):
fe = NativeFile("boot.bin", "dc/boot.bin", "dc",