1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Add failing tests of subzone handling

This commit is contained in:
Ross McFarland
2022-08-11 06:18:05 -07:00
parent 35a6c85bbb
commit 6e5c7a8b70
2 changed files with 30 additions and 0 deletions

View File

@@ -102,6 +102,8 @@ class Manager(object):
plan = p[1]
return len(plan.changes[0].record.zone.name) if plan.changes else 0
# TODO: all of this should get broken up, mainly so that it's not so huge
# and each bit can be cleanly tested independently
def __init__(self, config_file, max_workers=None, include_meta=False):
version = self._try_version('octodns', version=__VERSION__)
self.log.info(

View File

@@ -712,6 +712,34 @@ class TestManager(TestCase):
),
)
def test_subzone_handling(self):
manager = Manager(get_config_filename('simple.yaml'))
manager.config['zones'] = {
'unit.tests.': {},
'sub.unit.tests.': {},
'another.sub.unit.tests.': {},
'skipped.alevel.unit.tests.': {},
}
self.assertEqual(
{'unit.tests': {'skipped.alevel': {}, 'sub': {'another': {}}}},
manager.zone_tree,
)
self.assertEqual(
{'sub', 'skipped.alevel'},
manager.configured_sub_zones('unit.tests.'),
)
self.assertEqual(
{'another'}, manager.configured_sub_zones('sub.unit.tests.')
)
self.assertEqual(
set(), manager.configured_sub_zones('another.unit.tests.')
)
self.assertEqual(
set(), manager.configured_sub_zones('skipped.alevel.unit.tests.')
)
class TestMainThreadExecutor(TestCase):
def test_success(self):