Let adapter plugins provide configured endpoints
This commit is contained in:
@@ -150,6 +150,15 @@ class ReconcileCliTests(unittest.TestCase):
|
||||
verizon_endpoint.identity: verizon,
|
||||
}
|
||||
|
||||
def endpoint_loader(name, config):
|
||||
if name == "npm":
|
||||
return (npm_endpoint,)
|
||||
if name == "verizon":
|
||||
return (verizon_endpoint,)
|
||||
raise AssertionError(
|
||||
f"Unexpected adapter plugin: {name}"
|
||||
)
|
||||
|
||||
def loader(name, config, endpoint):
|
||||
return adapters[endpoint.identity]
|
||||
|
||||
@@ -167,6 +176,9 @@ class ReconcileCliTests(unittest.TestCase):
|
||||
"ENABLED_PLUGINS": "npm,verizon",
|
||||
},
|
||||
clear=True,
|
||||
), patch(
|
||||
"dns_sync.cli.configured_adapter_endpoints",
|
||||
side_effect=endpoint_loader,
|
||||
), patch(
|
||||
"dns_sync.cli.load_adapter",
|
||||
side_effect=loader,
|
||||
|
||||
Reference in New Issue
Block a user