Files
IQ.Pilot/iqpilot/system/hardware/tici/tests/test_agnos_updater.py
2026-08-16 22:28:41 -05:00

21 lines
541 B
Python

import json
import os
import requests
TEST_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)))
MANIFEST = os.path.join(TEST_DIR, "../agnos.json")
class TestAgnosUpdater:
def test_manifest(self):
with open(MANIFEST) as f:
m = json.load(f)
for img in m:
r = requests.head(img['url'], timeout=10)
r.raise_for_status()
assert r.headers['Content-Type'].split(';', 1)[0] in {"application/x-xz", "application/octet-stream"}
if not img['sparse']:
assert img['hash'] == img['hash_raw']