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