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

Full TinyDNS rework test coverage

This commit is contained in:
Ross McFarland
2023-06-30 16:36:19 -07:00
parent 7920b815f3
commit 34980504b3
3 changed files with 10 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ class TestTinyDnsFileSource(TestCase):
def test_populate_normal(self):
got = Zone('example.com.', [])
self.source.populate(got)
self.assertEqual(24, len(got.records))
self.assertEqual(25, len(got.records))
expected = Zone('example.com.', [])
for name, data in (
@@ -48,6 +48,10 @@ class TestTinyDnsFileSource(TestCase):
'cname',
{'type': 'CNAME', 'ttl': 3600, 'value': 'www.example.com.'},
),
(
'cname2',
{'type': 'CNAME', 'ttl': 48, 'value': 'www2.example.com.'},
),
(
'some-host-abc123',
{'type': 'A', 'ttl': 1800, 'value': '10.2.3.7'},
@@ -66,7 +70,7 @@ class TestTinyDnsFileSource(TestCase):
'exchange': 'smtp-1-host.example.com.',
},
{
'preference': 20,
'preference': 0,
'exchange': 'smtp-2-host.example.com.',
},
],
@@ -212,4 +216,4 @@ class TestTinyDnsFileSource(TestCase):
got = Zone('example.com.', ['sub'])
self.source.populate(got)
# we don't see one www.sub.example.com. record b/c it's in a sub
self.assertEqual(23, len(got.records))
self.assertEqual(24, len(got.records))

View File

@@ -26,14 +26,14 @@ Ccname.other.foo:www.other.foo
# MX
@example.com::smtp-1-host.example.com:10
@example.com.::smtp-2-host.example.com:20
@example.com.::smtp-2-host.example.com.
# MX with ttl and ip
@smtp.example.com:21.22.23.24:smtp-3-host:30:1800
@smtp.example.com.:22.23.24.25:smtp-4-host:40:1800
# NS for sub
.sub.example.com::ns3.ns.com:30
.sub.example.com.::ns4.ns.com:30
.sub.example.com.::ns4.ns.com.:30
# NS with ip
.other.example.com:14.15.16.17:ns5:30
.other.example.com.:15.16.17.18:ns6:30

View File

@@ -3,5 +3,6 @@
# CNAME with trailing comment
Ccname.example.com:www.example.com # this is a comment
Ccname2.example.com:www2.example.com.:48
+www.other.foo:14.2.3.6