mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Ignoring URLFWD and adjusting test counts for other providers
This commit is contained in:
@@ -121,12 +121,12 @@ class TestManager(TestCase):
|
|||||||
environ['YAML_TMP_DIR'] = tmpdir.dirname
|
environ['YAML_TMP_DIR'] = tmpdir.dirname
|
||||||
tc = Manager(get_config_filename('simple.yaml')) \
|
tc = Manager(get_config_filename('simple.yaml')) \
|
||||||
.sync(dry_run=False)
|
.sync(dry_run=False)
|
||||||
self.assertEquals(25, tc)
|
self.assertEquals(26, tc)
|
||||||
|
|
||||||
# try with just one of the zones
|
# try with just one of the zones
|
||||||
tc = Manager(get_config_filename('simple.yaml')) \
|
tc = Manager(get_config_filename('simple.yaml')) \
|
||||||
.sync(dry_run=False, eligible_zones=['unit.tests.'])
|
.sync(dry_run=False, eligible_zones=['unit.tests.'])
|
||||||
self.assertEquals(19, tc)
|
self.assertEquals(20, tc)
|
||||||
|
|
||||||
# the subzone, with 2 targets
|
# the subzone, with 2 targets
|
||||||
tc = Manager(get_config_filename('simple.yaml')) \
|
tc = Manager(get_config_filename('simple.yaml')) \
|
||||||
@@ -141,18 +141,18 @@ class TestManager(TestCase):
|
|||||||
# Again with force
|
# Again with force
|
||||||
tc = Manager(get_config_filename('simple.yaml')) \
|
tc = Manager(get_config_filename('simple.yaml')) \
|
||||||
.sync(dry_run=False, force=True)
|
.sync(dry_run=False, force=True)
|
||||||
self.assertEquals(25, tc)
|
self.assertEquals(26, tc)
|
||||||
|
|
||||||
# Again with max_workers = 1
|
# Again with max_workers = 1
|
||||||
tc = Manager(get_config_filename('simple.yaml'), max_workers=1) \
|
tc = Manager(get_config_filename('simple.yaml'), max_workers=1) \
|
||||||
.sync(dry_run=False, force=True)
|
.sync(dry_run=False, force=True)
|
||||||
self.assertEquals(25, tc)
|
self.assertEquals(26, tc)
|
||||||
|
|
||||||
# Include meta
|
# Include meta
|
||||||
tc = Manager(get_config_filename('simple.yaml'), max_workers=1,
|
tc = Manager(get_config_filename('simple.yaml'), max_workers=1,
|
||||||
include_meta=True) \
|
include_meta=True) \
|
||||||
.sync(dry_run=False, force=True)
|
.sync(dry_run=False, force=True)
|
||||||
self.assertEquals(29, tc)
|
self.assertEquals(30, tc)
|
||||||
|
|
||||||
def test_eligible_sources(self):
|
def test_eligible_sources(self):
|
||||||
with TemporaryDirectory() as tmpdir:
|
with TemporaryDirectory() as tmpdir:
|
||||||
@@ -218,13 +218,13 @@ class TestManager(TestCase):
|
|||||||
fh.write('---\n{}')
|
fh.write('---\n{}')
|
||||||
|
|
||||||
changes = manager.compare(['in'], ['dump'], 'unit.tests.')
|
changes = manager.compare(['in'], ['dump'], 'unit.tests.')
|
||||||
self.assertEquals(19, len(changes))
|
self.assertEquals(20, len(changes))
|
||||||
|
|
||||||
# Compound sources with varying support
|
# Compound sources with varying support
|
||||||
changes = manager.compare(['in', 'nosshfp'],
|
changes = manager.compare(['in', 'nosshfp'],
|
||||||
['dump'],
|
['dump'],
|
||||||
'unit.tests.')
|
'unit.tests.')
|
||||||
self.assertEquals(18, len(changes))
|
self.assertEquals(19, len(changes))
|
||||||
|
|
||||||
with self.assertRaises(ManagerException) as ctx:
|
with self.assertRaises(ManagerException) as ctx:
|
||||||
manager.compare(['nope'], ['dump'], 'unit.tests.')
|
manager.compare(['nope'], ['dump'], 'unit.tests.')
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ class TestConstellixProvider(TestCase):
|
|||||||
plan = provider.plan(self.expected)
|
plan = provider.plan(self.expected)
|
||||||
|
|
||||||
# No root NS, no ignored, no excluded, no unsupported
|
# No root NS, no ignored, no excluded, no unsupported
|
||||||
n = len(self.expected.records) - 7
|
n = len(self.expected.records) - 8
|
||||||
self.assertEquals(n, len(plan.changes))
|
self.assertEquals(n, len(plan.changes))
|
||||||
self.assertEquals(n, provider.apply(plan))
|
self.assertEquals(n, provider.apply(plan))
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class TestDigitalOceanProvider(TestCase):
|
|||||||
plan = provider.plan(self.expected)
|
plan = provider.plan(self.expected)
|
||||||
|
|
||||||
# No root NS, no ignored, no excluded, no unsupported
|
# No root NS, no ignored, no excluded, no unsupported
|
||||||
n = len(self.expected.records) - 9
|
n = len(self.expected.records) - 10
|
||||||
self.assertEquals(n, len(plan.changes))
|
self.assertEquals(n, len(plan.changes))
|
||||||
self.assertEquals(n, provider.apply(plan))
|
self.assertEquals(n, provider.apply(plan))
|
||||||
self.assertFalse(plan.exists)
|
self.assertFalse(plan.exists)
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class TestDnsimpleProvider(TestCase):
|
|||||||
plan = provider.plan(self.expected)
|
plan = provider.plan(self.expected)
|
||||||
|
|
||||||
# No root NS, no ignored, no excluded
|
# No root NS, no ignored, no excluded
|
||||||
n = len(self.expected.records) - 7
|
n = len(self.expected.records) - 8
|
||||||
self.assertEquals(n, len(plan.changes))
|
self.assertEquals(n, len(plan.changes))
|
||||||
self.assertEquals(n, provider.apply(plan))
|
self.assertEquals(n, provider.apply(plan))
|
||||||
self.assertFalse(plan.exists)
|
self.assertFalse(plan.exists)
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class TestDnsMadeEasyProvider(TestCase):
|
|||||||
plan = provider.plan(self.expected)
|
plan = provider.plan(self.expected)
|
||||||
|
|
||||||
# No root NS, no ignored, no excluded, no unsupported
|
# No root NS, no ignored, no excluded, no unsupported
|
||||||
n = len(self.expected.records) - 9
|
n = len(self.expected.records) - 10
|
||||||
self.assertEquals(n, len(plan.changes))
|
self.assertEquals(n, len(plan.changes))
|
||||||
self.assertEquals(n, provider.apply(plan))
|
self.assertEquals(n, provider.apply(plan))
|
||||||
|
|
||||||
|
|||||||
@@ -374,7 +374,7 @@ class TestEasyDNSProvider(TestCase):
|
|||||||
plan = provider.plan(self.expected)
|
plan = provider.plan(self.expected)
|
||||||
|
|
||||||
# No root NS, no ignored, no excluded, no unsupported
|
# No root NS, no ignored, no excluded, no unsupported
|
||||||
n = len(self.expected.records) - 8
|
n = len(self.expected.records) - 9
|
||||||
self.assertEquals(n, len(plan.changes))
|
self.assertEquals(n, len(plan.changes))
|
||||||
self.assertEquals(n, provider.apply(plan))
|
self.assertEquals(n, provider.apply(plan))
|
||||||
self.assertFalse(plan.exists)
|
self.assertFalse(plan.exists)
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ class TestGandiProvider(TestCase):
|
|||||||
plan = provider.plan(self.expected)
|
plan = provider.plan(self.expected)
|
||||||
|
|
||||||
# No root NS, no ignored, no excluded, no LOC
|
# No root NS, no ignored, no excluded, no LOC
|
||||||
n = len(self.expected.records) - 5
|
n = len(self.expected.records) - 6
|
||||||
self.assertEquals(n, len(plan.changes))
|
self.assertEquals(n, len(plan.changes))
|
||||||
self.assertEquals(n, provider.apply(plan))
|
self.assertEquals(n, provider.apply(plan))
|
||||||
self.assertFalse(plan.exists)
|
self.assertFalse(plan.exists)
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class TestHetznerProvider(TestCase):
|
|||||||
plan = provider.plan(self.expected)
|
plan = provider.plan(self.expected)
|
||||||
|
|
||||||
# No root NS, no ignored, no excluded, no unsupported
|
# No root NS, no ignored, no excluded, no unsupported
|
||||||
n = len(self.expected.records) - 9
|
n = len(self.expected.records) - 10
|
||||||
self.assertEquals(n, len(plan.changes))
|
self.assertEquals(n, len(plan.changes))
|
||||||
self.assertEquals(n, provider.apply(plan))
|
self.assertEquals(n, provider.apply(plan))
|
||||||
self.assertFalse(plan.exists)
|
self.assertFalse(plan.exists)
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ class TestPowerDnsProvider(TestCase):
|
|||||||
expected = Zone('unit.tests.', [])
|
expected = Zone('unit.tests.', [])
|
||||||
source = YamlProvider('test', join(dirname(__file__), 'config'))
|
source = YamlProvider('test', join(dirname(__file__), 'config'))
|
||||||
source.populate(expected)
|
source.populate(expected)
|
||||||
expected_n = len(expected.records) - 3
|
expected_n = len(expected.records) - 4
|
||||||
self.assertEquals(19, expected_n)
|
self.assertEquals(19, expected_n)
|
||||||
|
|
||||||
# No diffs == no changes
|
# No diffs == no changes
|
||||||
@@ -291,7 +291,7 @@ class TestPowerDnsProvider(TestCase):
|
|||||||
expected = Zone('unit.tests.', [])
|
expected = Zone('unit.tests.', [])
|
||||||
source = YamlProvider('test', join(dirname(__file__), 'config'))
|
source = YamlProvider('test', join(dirname(__file__), 'config'))
|
||||||
source.populate(expected)
|
source.populate(expected)
|
||||||
self.assertEquals(22, len(expected.records))
|
self.assertEquals(23, len(expected.records))
|
||||||
|
|
||||||
# A small change to a single record
|
# A small change to a single record
|
||||||
with requests_mock() as mock:
|
with requests_mock() as mock:
|
||||||
|
|||||||
Reference in New Issue
Block a user