import json import tempfile import unittest from pathlib import Path from sys import path path.insert(0, str(Path(__file__).resolve().parents[1] / 'scripts')) from sync import validate class TestSync(unittest.TestCase): def test_example(self): validate({'openssl': {'CVE-2024-0001': {'releases': {'bookworm': {'status': 'resolved', 'fixed_version': '1.2'}}}}}) def test_bad(self): with self.assertRaises(ValueError): validate([]) if __name__ == '__main__': unittest.main()