Browse Source

Add test for alias zones

pull/592/head
Jonathan Leroy 5 years ago
parent
commit
b0da090723
No known key found for this signature in database GPG Key ID: 7A0BCBE3934842EA
2 changed files with 22 additions and 2 deletions
  1. +7
    -2
      tests/config/unknown-source-zone.yaml
  2. +15
    -0
      tests/test_octodns_manager.py

+ 7
- 2
tests/config/unknown-source-zone.yaml 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.

+ 15
- 0
tests/test_octodns_manager.py 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


Loading…
Cancel
Save