mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Added test for missing zone file
This commit is contained in:
@@ -600,7 +600,12 @@ class Manager(object):
|
||||
aliased_zones = {}
|
||||
delayed_arpa = []
|
||||
futures = []
|
||||
|
||||
for zone_name, config in zones.items():
|
||||
if config is None:
|
||||
raise ManagerException(
|
||||
f'Passed zone: {zone_name} not found in config'
|
||||
)
|
||||
decoded_zone_name = idna_decode(zone_name)
|
||||
self.log.info('sync: zone=%s', decoded_zone_name)
|
||||
if 'alias' in config:
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
manager:
|
||||
max_workers: 2
|
||||
providers:
|
||||
in:
|
||||
class: octodns.provider.yaml.YamlProvider
|
||||
directory: tests/config
|
||||
dump:
|
||||
class: octodns.provider.yaml.YamlProvider
|
||||
directory: env/YAML_TMP_DIR
|
||||
zones: {}
|
||||
@@ -79,6 +79,11 @@ class TestManager(TestCase):
|
||||
)
|
||||
self.assertTrue('missing sources' in str(ctx.exception))
|
||||
|
||||
def test_missing_zone(self):
|
||||
with self.assertRaises(ManagerException) as ctx:
|
||||
Manager(get_config_filename('missing-zone-config.yaml')).sync()
|
||||
self.assertTrue('Passed zone:' in str(ctx.exception))
|
||||
|
||||
def test_missing_targets(self):
|
||||
with self.assertRaises(ManagerException) as ctx:
|
||||
Manager(get_config_filename('provider-problems.yaml')).sync(
|
||||
|
||||
Reference in New Issue
Block a user