Move Verizon endpoint config into plugin

This commit is contained in:
Lyncoln
2026-09-20 20:29:40 -04:00
parent 16359dc164
commit ed97b644e8
4 changed files with 27 additions and 54 deletions
-42
View File
@@ -115,48 +115,6 @@ class AppConfigEndpointTests(unittest.TestCase):
):
AppConfig.from_env()
def test_verizon_endpoint_list_is_plugin_specific(self):
with patch.dict(
os.environ,
{
"NPM_ENDPOINTS": "192.168.1.3",
"VERIZON_ENDPOINTS": (
"192.168.1.1,192.168.1.254:8443"
),
},
clear=True,
):
config = AppConfig.from_env()
self.assertEqual(
tuple(
endpoint.identity
for endpoint in config.verizon_endpoints
),
(
"verizon://192.168.1.1:443",
"verizon://192.168.1.254:8443",
),
)
def test_router_url_does_not_configure_generic_endpoint(self):
with patch.dict(
os.environ,
{
"NPM_ENDPOINTS": "192.168.1.3",
"ROUTER_URL": "https://192.168.1.254",
},
clear=True,
):
config = AppConfig.from_env()
self.assertEqual(
tuple(
endpoint.identity
for endpoint in config.verizon_endpoints
),
("verizon://192.168.1.1:443",),
)
if __name__ == "__main__":
+16 -3
View File
@@ -13,7 +13,10 @@ from dns_sync.adapters import (
)
from dns_sync.config import AppConfig
from dns_sync.models import ProviderRecord
from dns_sync.registry import load_adapter
from dns_sync.registry import (
configured_adapter_endpoints,
load_adapter,
)
class VerizonAdapterTests(unittest.TestCase):
@@ -57,10 +60,15 @@ class VerizonAdapterTests(unittest.TestCase):
"VerizonProvider",
return_value=provider,
):
endpoint = configured_adapter_endpoints(
"verizon",
config,
)[0]
return load_adapter(
"verizon",
config,
config.verizon_endpoints[0],
endpoint,
)
@staticmethod
@@ -143,10 +151,15 @@ class VerizonAdapterTests(unittest.TestCase):
clear=True,
):
config = AppConfig.from_env()
endpoint = configured_adapter_endpoints(
"verizon",
config,
)[0]
adapter = load_adapter(
"verizon",
config,
config.verizon_endpoints[0],
endpoint,
)
self.assertEqual(