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:
@@ -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(
|
||||
|
@@ -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):
|
||||
|
Reference in New Issue
Block a user