Browse Source

Add tests for TinyDNS TXT records

pull/343/head
Andy Hawkins 7 years ago
parent
commit
1892489e77
2 changed files with 21 additions and 2 deletions
  1. +17
    -2
      tests/test_octodns_source_tinydns.py
  2. +4
    -0
      tests/zones/tinydns/example.com

+ 17
- 2
tests/test_octodns_source_tinydns.py View File

@ -20,7 +20,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.assertEquals(11, len(got.records))
self.assertEquals(14, len(got.records))
expected = Zone('example.com.', []) expected = Zone('example.com.', [])
for name, data in ( for name, data in (
@ -86,6 +86,21 @@ class TestTinyDnsFileSource(TestCase):
'exchange': 'smtp-2-host.example.com.', 'exchange': 'smtp-2-host.example.com.',
}] }]
}), }),
('', {
'type': 'TXT',
'ttl': 300,
'value': 'test TXT',
}),
('colon', {
'type': 'TXT',
'ttl': 300,
'value': 'test : TXT',
}),
('nottl', {
'type': 'TXT',
'ttl': 3600,
'value': 'nottl test TXT',
}),
): ):
record = Record.new(expected, name, data) record = Record.new(expected, name, data)
expected.add_record(record) expected.add_record(record)
@ -173,4 +188,4 @@ class TestTinyDnsFileSource(TestCase):
def test_ignores_subs(self): def test_ignores_subs(self):
got = Zone('example.com.', ['sub']) got = Zone('example.com.', ['sub'])
self.source.populate(got) self.source.populate(got)
self.assertEquals(10, len(got.records))
self.assertEquals(13, len(got.records))

+ 4
- 0
tests/zones/tinydns/example.com View File

@ -46,3 +46,7 @@ Ccname.other.foo:www.other.foo
+a1.blah-asdf.subtest.com:10.2.3.5 +a1.blah-asdf.subtest.com:10.2.3.5
+a2.blah-asdf.subtest.com:10.2.3.6 +a2.blah-asdf.subtest.com:10.2.3.6
+a3.asdf.subtest.com:10.2.3.7 +a3.asdf.subtest.com:10.2.3.7
'example.com:test TXT:300
'colon.example.com:test \072 TXT:300
'nottl.example.com:nottl test TXT

Loading…
Cancel
Save