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:
@@ -17,7 +17,7 @@ class TestTinyDnsFileSource(TestCase):
|
|||||||
def test_populate_normal(self):
|
def test_populate_normal(self):
|
||||||
got = Zone('example.com.', [])
|
got = Zone('example.com.', [])
|
||||||
self.source.populate(got)
|
self.source.populate(got)
|
||||||
self.assertEqual(24, len(got.records))
|
self.assertEqual(25, len(got.records))
|
||||||
|
|
||||||
expected = Zone('example.com.', [])
|
expected = Zone('example.com.', [])
|
||||||
for name, data in (
|
for name, data in (
|
||||||
@@ -48,6 +48,10 @@ class TestTinyDnsFileSource(TestCase):
|
|||||||
'cname',
|
'cname',
|
||||||
{'type': 'CNAME', 'ttl': 3600, 'value': 'www.example.com.'},
|
{'type': 'CNAME', 'ttl': 3600, 'value': 'www.example.com.'},
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
'cname2',
|
||||||
|
{'type': 'CNAME', 'ttl': 48, 'value': 'www2.example.com.'},
|
||||||
|
),
|
||||||
(
|
(
|
||||||
'some-host-abc123',
|
'some-host-abc123',
|
||||||
{'type': 'A', 'ttl': 1800, 'value': '10.2.3.7'},
|
{'type': 'A', 'ttl': 1800, 'value': '10.2.3.7'},
|
||||||
@@ -66,7 +70,7 @@ class TestTinyDnsFileSource(TestCase):
|
|||||||
'exchange': 'smtp-1-host.example.com.',
|
'exchange': 'smtp-1-host.example.com.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'preference': 20,
|
'preference': 0,
|
||||||
'exchange': 'smtp-2-host.example.com.',
|
'exchange': 'smtp-2-host.example.com.',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -212,4 +216,4 @@ class TestTinyDnsFileSource(TestCase):
|
|||||||
got = Zone('example.com.', ['sub'])
|
got = Zone('example.com.', ['sub'])
|
||||||
self.source.populate(got)
|
self.source.populate(got)
|
||||||
# we don't see one www.sub.example.com. record b/c it's in a sub
|
# 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))
|
||||||
|
@@ -26,14 +26,14 @@ Ccname.other.foo:www.other.foo
|
|||||||
|
|
||||||
# MX
|
# MX
|
||||||
@example.com::smtp-1-host.example.com:10
|
@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
|
# MX with ttl and ip
|
||||||
@smtp.example.com:21.22.23.24:smtp-3-host:30:1800
|
@smtp.example.com:21.22.23.24:smtp-3-host:30:1800
|
||||||
@smtp.example.com.:22.23.24.25:smtp-4-host:40:1800
|
@smtp.example.com.:22.23.24.25:smtp-4-host:40:1800
|
||||||
|
|
||||||
# NS for sub
|
# NS for sub
|
||||||
.sub.example.com::ns3.ns.com:30
|
.sub.example.com::ns3.ns.com:30
|
||||||
.sub.example.com.::ns4.ns.com:30
|
.sub.example.com.::ns4.ns.com.:30
|
||||||
# NS with ip
|
# NS with ip
|
||||||
.other.example.com:14.15.16.17:ns5:30
|
.other.example.com:14.15.16.17:ns5:30
|
||||||
.other.example.com.:15.16.17.18:ns6:30
|
.other.example.com.:15.16.17.18:ns6:30
|
||||||
|
@@ -3,5 +3,6 @@
|
|||||||
|
|
||||||
# CNAME with trailing comment
|
# CNAME with trailing comment
|
||||||
Ccname.example.com:www.example.com # this is a 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
|
+www.other.foo:14.2.3.6
|
||||||
|
Reference in New Issue
Block a user