Files
github-octodns/tests/test_octodns_processor.py
Ross McFarland c5a9ba518b Processors.process_zone_config, dynamic zone config converted
* `Processors.process_zone_config` method added to allow processors that work
  with the zone config data. Configured with `manager.zone-processors: []`,
  default is ['dynamic-zone-config']
* Converted dynamic zone config to be a processors ^, if zone-processors are
  explicitely configured and dynamic zone config is desired
  `dyanmic-zone-config` must be included in the list as the desired position
* Loads of additional testin/vetting for the above functionality
2023-12-06 14:21:13 -08:00

44 lines
1.1 KiB
Python

#
#
#
from unittest import TestCase
from octodns.processor.base import BaseProcessor
class BaseProcessorTest(TestCase):
proc = BaseProcessor('test')
def test_process_zone_config(self):
def get_sources(name, config):
return []
zones = {}
got = self.proc.process_zone_config(zones, get_sources)
self.assertIs(zones, got)
def test_process_source_zone(self):
desired = 42
got = self.proc.process_source_zone(desired, [])
self.assertIs(desired, got)
def test_process_target_zone(self):
existing = 43
got = self.proc.process_target_zone(existing, None)
self.assertIs(existing, got)
def test_process_source_and_target_zones(self):
desired = 42
existing = 43
got_desired, got_existing = self.proc.process_source_and_target_zones(
desired, existing, None
)
self.assertIs(desired, got_desired)
self.assertIs(existing, got_existing)
def test_process_plan(self):
plan = 42
got = self.proc.process_plan(plan, [], None)
self.assertIs(plan, got)