Browse Source

Add comments and fixes some tests

pull/592/head
Jonathan Leroy 5 years ago
parent
commit
038ae42284
No known key found for this signature in database GPG Key ID: 7A0BCBE3934842EA
1 changed files with 13 additions and 15 deletions
  1. +13
    -15
      tests/test_octodns_manager.py

+ 13
- 15
tests/test_octodns_manager.py View File

@ -170,11 +170,12 @@ class TestManager(TestCase):
def test_aliases(self):
with TemporaryDirectory() as tmpdir:
environ['YAML_TMP_DIR'] = tmpdir.dirname
# Only allow a target that doesn't exist
# Alias zones with a valid target.
tc = Manager(get_config_filename('simple-alias-zone.yaml')) \
.sync()
self.assertEquals(0, tc)
# Alias zone with an invalid target.
with self.assertRaises(ManagerException) as ctx:
tc = Manager(get_config_filename('unknown-source-zone.yaml')) \
.sync()
@ -301,6 +302,17 @@ class TestManager(TestCase):
.validate_configs()
self.assertTrue('unknown source' in text_type(ctx.exception))
# Alias zone using an invalid source zone.
with self.assertRaises(ManagerException) as ctx:
Manager(get_config_filename('unknown-source-zone.yaml')) \
.validate_configs()
self.assertTrue('Invalid alias zone' in
text_type(ctx.exception))
# Valid config file using an alias zone.
Manager(get_config_filename('simple-alias-zone.yaml')) \
.validate_configs()
def test_get_zone(self):
Manager(get_config_filename('simple.yaml')).get_zone('unit.tests.')
@ -336,20 +348,6 @@ class TestManager(TestCase):
with self.assertRaises(TypeError):
manager._populate_and_plan('unit.tests.', [NoZone()], [])
def test_alias_zones(self):
with TemporaryDirectory() as tmpdir:
environ['YAML_TMP_DIR'] = tmpdir.dirname
Manager(get_config_filename('simple-alias-zone.yaml')) \
.validate_configs()
with self.assertRaises(ManagerException) as ctx:
Manager(get_config_filename('unknown-source-zone.yaml')) \
.validate_configs()
self.assertTrue('Invalid alias zone' in
text_type(ctx.exception))
class TestMainThreadExecutor(TestCase):
def test_success(self):


Loading…
Cancel
Save