chore: merge the verify and truth quality work

This commit is contained in:
Abdessamad Derraz committed 2026-11-17 09:48:56 +01:00
commit e14a7d79bb
26 files changed
+3555 -2651

No files matched your search

+3 -3
View File
@@ -145,7 +145,7 @@ class RetroDeckWritesWhatItCounts(unittest.TestCase):
written = json.loads(produced["duckstation/component_manifest.json"])
names = [e["filename"] for e in written["duckstation"]["bios"]]
self.assertIn("b.bin", names)
self.assertFalse(RetroDeck.writable(spread.files[2]))
self.assertFalse(RetroDeck().writable(spread.files[2]))
class HashesTheFormatCannotHold(unittest.TestCase):
@@ -434,8 +434,8 @@ class OneMd5FormatsAddWhole(unittest.TestCase):
several = NativeFile("boot.bin", "boot.bin", "dc", truth={"md5": [A, B, C]})
single = NativeFile("boot2.bin", "boot2.bin", "dc", truth={"md5": A})
self.assertFalse(RetroBat.writable(several))
self.assertTrue(RetroBat.writable(single))
self.assertFalse(RetroBat().writable(several))
self.assertTrue(RetroBat().writable(single))
class BizHawkKeepsItsOwnHashes(unittest.TestCase):
+20 -2
View File
@@ -558,7 +558,7 @@ class Reconciliation(unittest.TestCase):
}
systems, _ = build_native_model({"systems": {}}, scraped)
entry = systems["nds"].files[0]
self.assertTrue(BaseExporter.writable(entry, require="md5"))
self.assertTrue(_BaseRule().writable(entry, require="md5"))
def test_no_format_drops_what_the_platform_already_declares(self):
"""An export poorer than the file it corrects is not usable."""
@@ -579,7 +579,25 @@ class Reconciliation(unittest.TestCase):
}
systems, _ = build_native_model(truth, None)
entry = systems["nintendo-ds"].files[0]
self.assertFalse(BaseExporter.writable(entry, require="md5"))
self.assertFalse(_BaseRule().writable(entry, require="md5"))
class _BaseRule(BaseExporter):
"""A concrete exporter that keeps every rule of the base class."""
@staticmethod
def platform_name() -> str:
return "base"
@staticmethod
def native_filename() -> str:
return "base"
def render(self, systems, report, originals, scraped=None):
return {}
def validate(self, systems, produced):
return []
class ExporterRegistry(unittest.TestCase):