17 lines
730 B
Python
17 lines
730 B
Python
"""Pinned public protocol vectors replace imports of the extracted VPS server."""
|
|
|
|
import hashlib
|
|
import json
|
|
from pathlib import Path
|
|
|
|
|
|
def test_client_codecs_match_the_qualified_server_contract():
|
|
root = Path(__file__).resolve().parents[1]
|
|
contract = json.loads((root / "tests/fixtures/arnavi_vps/client-v1.json").read_text())
|
|
assert contract["schema"] == "nodedc.arnavi-client-contract/v1"
|
|
assert contract["synthetic_only"] is True
|
|
for server_name, digest in contract["codec_sha256"].items():
|
|
name = "internal.py" if server_name == "arnavi.py" else server_name
|
|
path = root / "src/k1link/device_plugins/arnavi_b2" / name
|
|
assert hashlib.sha256(path.read_bytes()).hexdigest() == digest
|