File size: 522 Bytes
0eeed4c
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
"""Keep historical freeze manifests while auditing the explicitly patched adapter."""
import hashlib
import json


def assert_source_hash(case, root, row):
    expected = row['sha256']
    if row['path'] == 'kdflow/algorithms/mp_opd.py':
        patch = json.loads((root / 'docs/MP_OPD_INVALID_RESPONSES.json').read_text())
        case.assertEqual(expected, patch['baseline_sha256'])
        expected = patch['updated_sha256']
    case.assertEqual(hashlib.sha256((root / row['path']).read_bytes()).hexdigest(), expected)