refactor: point tests at the packs modules

This commit is contained in:
Abdessamad Derraz committed 2026-11-18 13:47:31 +01:00
1 parent f48b66b540
commit 74207e25fc
50 files changed
+321 -259

No files matched your search

+3 -3
View File
@@ -262,14 +262,14 @@ class SymlinksAreRefusedBeforeReading(_Fixture):
link = self.tmp / "bios" / "Sony" / "PS" / "link.bin"
link.symlink_to(self.tmp / "bios" / "Sony" / "PS" / "real.bin")
calls = []
real = validate_pr.compute_hashes
validate_pr.compute_hashes = lambda p, *a, **k: (
real = review.compute_hashes
review.compute_hashes = lambda p, *a, **k: (
calls.append(p) or real(p, *a, **k)
)
try:
review.validate_file("bios/Sony/PS/link.bin", None, EMPTY_HASHES)
finally:
validate_pr.compute_hashes = real
review.compute_hashes = real
self.assertEqual(calls, [], "a symlink target must not be read")
@unittest.skipUnless(os.path.exists("/dev/zero"), "needs /dev/zero")