Доплнен отчет

This commit is contained in:
2026-11-12 19:56:00 +03:00
parent f3ba37f736
commit 8ec5e903c3
15 changed files with 890 additions and 643 deletions
+15
View File
@@ -0,0 +1,15 @@
"""Verify that every file supplied in the lab4 skeleton is byte-for-byte unchanged."""
import hashlib
import json
from pathlib import Path
root=Path(__file__).resolve().parents[1]
baseline=json.loads((root/'course-files.sha256.json').read_text())
changed=[]
for name,digest in baseline['files'].items():
path=root/name
if not path.is_file() or hashlib.sha256(path.read_bytes()).hexdigest()!=digest:
changed.append(name)
if changed:
raise SystemExit('Изменены исходные файлы преподавателя: '+', '.join(changed))
print('PASS: all '+str(len(baseline['files']))+' supplied lab4 files are unchanged')