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

Add test for alias zones

This commit is contained in:
Jonathan Leroy
2020-10-31 14:09:54 +01:00
parent a2aa98377d
commit b0da090723
2 changed files with 22 additions and 2 deletions

View File

@@ -9,5 +9,10 @@ providers:
directory: env/YAML_TMP_DIR
zones:
unit.tests.:
alias: unit-source.tests.
sources:
- in
targets:
- dump
alias.tests.:
alias: does-not-exists.tests.

View File

@@ -167,6 +167,21 @@ class TestManager(TestCase):
.sync(eligible_targets=['foo'])
self.assertEquals(0, tc)
def test_aliases(self):
with TemporaryDirectory() as tmpdir:
environ['YAML_TMP_DIR'] = tmpdir.dirname
# Only allow a target that doesn't exist
tc = Manager(get_config_filename('simple-alias-zone.yaml')) \
.sync()
self.assertEquals(0, tc)
with self.assertRaises(ManagerException) as ctx:
tc = Manager(get_config_filename('unknown-source-zone.yaml')) \
.sync()
self.assertEquals('Invalid alias zone alias.tests.: source zone '
'does-not-exists.tests. does not exist',
text_type(ctx.exception))
def test_compare(self):
with TemporaryDirectory() as tmpdir:
environ['YAML_TMP_DIR'] = tmpdir.dirname