mirror of
https://github.com/p-e-w/heretic.git
synced 2026-10-02 08:51:27 -07:00
chore: update dependencies
This commit is contained in:
+11
-13
@@ -53,7 +53,7 @@ for test_directory in script_directory.iterdir():
|
||||
|
||||
print()
|
||||
|
||||
valid_hashes: dict[str, list[str]] = {}
|
||||
valid_hashes: dict[str, set[str]] = {}
|
||||
|
||||
for hash_file in hash_files:
|
||||
with open(hash_file, "r", encoding="utf-8") as file:
|
||||
@@ -63,25 +63,23 @@ for test_directory in script_directory.iterdir():
|
||||
filename = filename.removeprefix("*")
|
||||
|
||||
if filename not in valid_hashes:
|
||||
valid_hashes[filename] = []
|
||||
valid_hashes[filename] = set()
|
||||
|
||||
valid_hashes[filename].append(sha256.lower())
|
||||
valid_hashes[filename].add(sha256.lower())
|
||||
|
||||
# Track which specific files failed within this test directory.
|
||||
failed_files: list[str] = []
|
||||
for filename in valid_hashes:
|
||||
for filename, hashes in valid_hashes.items():
|
||||
sha256 = get_file_sha256(test_directory / "model" / filename)
|
||||
|
||||
if sha256.lower() not in valid_hashes[filename]:
|
||||
if sha256.lower() not in hashes:
|
||||
print(
|
||||
(
|
||||
f"Test {test_directory.name} has FAILED!\n"
|
||||
f"Output file {filename} doesn't match any valid hash.\n\n"
|
||||
f"Valid hashes:\n"
|
||||
f"{chr(10).join(valid_hashes[filename])}\n\n"
|
||||
f"Actual hash:\n"
|
||||
f"{sha256}\n"
|
||||
)
|
||||
f"Test {test_directory.name} has FAILED!\n"
|
||||
f"Output file {filename} doesn't match any valid hash.\n\n"
|
||||
f"Valid hashes:\n"
|
||||
f"{chr(10).join(hashes)}\n\n"
|
||||
f"Actual hash:\n"
|
||||
f"{sha256}\n"
|
||||
)
|
||||
failed_files.append(filename)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user