Browse Source

Full TinyDNS rework test coverage

pull/1020/head
Ross McFarland 2 years ago
parent
commit
34980504b3
No known key found for this signature in database GPG Key ID: 943B179E15D3B22A
3 changed files with 10 additions and 5 deletions
  1. +7
    -3
      tests/test_octodns_source_tinydns.py
  2. +2
    -2
      tests/zones/tinydns/example.com
  3. +1
    -0
      tests/zones/tinydns/other.foo

+ 7
- 3
tests/test_octodns_source_tinydns.py 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))

+ 2
- 2
tests/zones/tinydns/example.com 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


+ 1
- 0
tests/zones/tinydns/other.foo 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

Loading…
Cancel
Save