1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

AxfrSource and ZoneFileSource: support multi-value PTR records

This commit is contained in:
Adam Smith
2022-07-22 12:50:24 -04:00
parent a0841f4420
commit 2a56d9b26e
3 changed files with 35 additions and 2 deletions

View File

@@ -34,8 +34,14 @@ class TestAxfrSource(TestCase):
'./tests/zones/unit.tests.tst', 'unit.tests', relativize=False
)
reverse_zonefile = dns.zone.from_file(
'./tests/zones/2.0.192.in-addr.arpa.',
'2.0.192.in-addr.arpa',
relativize=False,
)
@patch('dns.zone.from_xfr')
def test_populate(self, from_xfr_mock):
def test_populate_forward(self, from_xfr_mock):
got = Zone('unit.tests.', [])
from_xfr_mock.side_effect = [self.forward_zonefile, DNSException]
@@ -48,6 +54,15 @@ class TestAxfrSource(TestCase):
self.source.populate(zone)
self.assertEqual('Unable to Perform Zone Transfer', str(ctx.exception))
@patch('dns.zone.from_xfr')
def test_populate_reverse(self, from_xfr_mock):
got = Zone('2.0.192.in-addr.arpa.', [])
from_xfr_mock.side_effect = [self.reverse_zonefile]
self.source.populate(got)
self.assertEqual(4, len(got.records))
class TestZoneFileSource(TestCase):
source = ZoneFileSource('test', './tests/zones', file_extension='.tst')