mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
fully check auto_arpa and eligible_* usage for safety
This commit is contained in:
@@ -908,7 +908,7 @@ class TestManager(TestCase):
|
||||
str(ctx.exception),
|
||||
)
|
||||
|
||||
def test_delayed_arpa(self):
|
||||
def test_auto_arpa(self):
|
||||
manager = Manager(get_config_filename('simple-arpa.yaml'))
|
||||
|
||||
with TemporaryDirectory() as tmpdir:
|
||||
@@ -917,7 +917,6 @@ class TestManager(TestCase):
|
||||
# we can sync eligible_zones so long as they're not arpa
|
||||
tc = manager.sync(dry_run=False, eligible_zones=['unit.tests.'])
|
||||
self.assertEqual(22, tc)
|
||||
|
||||
# can't do partial syncs that include arpa zones
|
||||
with self.assertRaises(ManagerException) as ctx:
|
||||
manager.sync(
|
||||
@@ -929,6 +928,36 @@ class TestManager(TestCase):
|
||||
str(ctx.exception),
|
||||
)
|
||||
|
||||
# same for eligible_sources
|
||||
tc = manager.sync(
|
||||
dry_run=False,
|
||||
eligible_zones=['unit.tests.'],
|
||||
eligible_sources=['in'],
|
||||
)
|
||||
self.assertEqual(22, tc)
|
||||
# can't do partial syncs that include arpa zones
|
||||
with self.assertRaises(ManagerException) as ctx:
|
||||
manager.sync(dry_run=False, eligible_sources=['in'])
|
||||
self.assertEqual(
|
||||
'eligible_sources is incompatible with auto_arpa',
|
||||
str(ctx.exception),
|
||||
)
|
||||
|
||||
# same for eligible_targets
|
||||
tc = manager.sync(
|
||||
dry_run=False,
|
||||
eligible_zones=['unit.tests.'],
|
||||
eligible_targets=['dump'],
|
||||
)
|
||||
self.assertEqual(22, tc)
|
||||
# can't do partial syncs that include arpa zones
|
||||
with self.assertRaises(ManagerException) as ctx:
|
||||
manager.sync(dry_run=False, eligible_targets=['dump'])
|
||||
self.assertEqual(
|
||||
'eligible_targets is incompatible with auto_arpa',
|
||||
str(ctx.exception),
|
||||
)
|
||||
|
||||
# full sync with arpa is fine, 2 extra records from it
|
||||
tc = manager.sync(dry_run=False)
|
||||
self.assertEqual(26, tc)
|
||||
|
||||
Reference in New Issue
Block a user