zapret-kvn/tests/test_amnezia_golden.py
loop-uh d5a4715771
Some checks failed
Windows project source guards / test (push) Has been cancelled
feat: use official Amnezia transport and organize runtime modules
2026-09-06 00:14:08 +03:00

18 lines
725 B
Python

import json
from pathlib import Path
import unittest
from xray_fluent.importer.link_parser import LinkParseError, parse_single
GOLDEN = Path(__file__).resolve().parents[1] / "runtime/amnezia/testdata/wg_awg_golden.json"
class AmneziaGoldenTests(unittest.TestCase):
def test_import_preserves_the_shared_native_transport(self):
for vector in json.loads(GOLDEN.read_text())["vectors"]:
with self.subTest(vector=vector["id"]):
if not vector["valid"]:
with self.assertRaises(LinkParseError):
parse_single(vector["conf"])
continue
self.assertEqual(parse_single(vector["conf"]).outbound, vector["endpoint"])