Prepare NPM references and mutation API

This commit is contained in:
Lyncoln
2026-09-19 22:52:14 -04:00
parent 8caac79a1e
commit 381119a6b5
6 changed files with 436 additions and 10 deletions
+24 -2
View File
@@ -6,6 +6,7 @@ from dns_sync.adapters import (
DNS_RECORDS,
PROXY_HOSTS,
DiscoveredObject,
ObjectReference,
)
from dns_sync.object_normalizer import (
normalize_discovered_object,
@@ -83,6 +84,13 @@ class ProxyHostNormalizationTests(unittest.TestCase):
"ssl_forced": 1,
"enabled": True,
},
references=(
ObjectReference(
relation="certificate",
object_type=CERTIFICATES,
local_key="67",
),
),
)
normalized = normalize_discovered_object(discovered)
@@ -97,9 +105,23 @@ class ProxyHostNormalizationTests(unittest.TestCase):
)
self.assertEqual(normalized.payload["forward_scheme"], "http")
self.assertEqual(normalized.payload["forward_port"], 8080)
self.assertNotIn(
"certificate_local_key",
normalized.payload,
)
self.assertNotIn(
"certificate_id",
normalized.payload,
)
self.assertEqual(
normalized.payload["certificate_local_key"],
"67",
normalized.references,
(
ObjectReference(
relation="certificate",
object_type=CERTIFICATES,
local_key="67",
),
),
)
self.assertTrue(normalized.payload["ssl_forced"])
self.assertTrue(normalized.payload["enabled"])