|
|
|
@ -561,6 +561,34 @@ class TestZone(TestCase): |
|
|
|
zone.add_record(a) |
|
|
|
self.assertEqual(set([a, cname]), zone.records) |
|
|
|
|
|
|
|
# adding something else w/o lenient still errors |
|
|
|
zone = Zone('unit.tests.', []) |
|
|
|
zone.add_record(cname) |
|
|
|
zone.add_record(a) |
|
|
|
txt = Record.new( |
|
|
|
zone, 'www', {'ttl': 60, 'type': 'TXT', 'value': 'Hello World'} |
|
|
|
) |
|
|
|
with self.assertRaises(InvalidNodeException): |
|
|
|
zone.add_record(txt) |
|
|
|
self.assertEqual(set([a, cname]), zone.records) |
|
|
|
|
|
|
|
# if the 3rd record is lenient it can be added |
|
|
|
zone = Zone('unit.tests.', []) |
|
|
|
zone.add_record(cname) |
|
|
|
zone.add_record(a) |
|
|
|
txt = Record.new( |
|
|
|
zone, |
|
|
|
'www', |
|
|
|
{ |
|
|
|
'ttl': 60, |
|
|
|
'type': 'TXT', |
|
|
|
'value': 'Hello World', |
|
|
|
'octodns': {'lenient': True}, |
|
|
|
}, |
|
|
|
) |
|
|
|
zone.add_record(txt) |
|
|
|
self.assertEqual(set([a, cname, txt]), zone.records) |
|
|
|
|
|
|
|
def test_excluded_records(self): |
|
|
|
zone_normal = Zone('unit.tests.', []) |
|
|
|
zone_excluded = Zone('unit.tests.', []) |
|
|
|
|