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

Add AliasRecord & tests

This commit is contained in:
Ross McFarland
2017-05-28 07:21:53 -07:00
parent f12bbd9191
commit 9e172ed303

View File

@@ -7,9 +7,9 @@ from __future__ import absolute_import, division, print_function, \
from unittest import TestCase from unittest import TestCase
from octodns.record import ARecord, AaaaRecord, CnameRecord, Create, Delete, \ from octodns.record import ARecord, AaaaRecord, AliasRecord, CnameRecord, \
GeoValue, MxRecord, NaptrRecord, NaptrValue, NsRecord, PtrRecord, Record, \ Create, Delete, GeoValue, MxRecord, NaptrRecord, NaptrValue, NsRecord, \
SshfpRecord, SpfRecord, SrvRecord, TxtRecord, Update PtrRecord, Record, SshfpRecord, SpfRecord, SrvRecord, TxtRecord, Update
from octodns.zone import Zone from octodns.zone import Zone
from helpers import GeoProvider, SimpleProvider from helpers import GeoProvider, SimpleProvider
@@ -242,6 +242,17 @@ class TestRecord(TestCase):
# __repr__ doesn't blow up # __repr__ doesn't blow up
a.__repr__() a.__repr__()
def test_alias(self):
self.assertSingleValue(AliasRecord, 'foo.unit.tests.',
'other.unit.tests.')
with self.assertRaises(Exception) as ctx:
AliasRecord(self.zone, '', {
'ttl': 31,
'value': 'foo.bar.com.'
})
self.assertTrue('in same zone' in ctx.exception.message)
def test_cname(self): def test_cname(self):
self.assertSingleValue(CnameRecord, 'target.foo.com.', self.assertSingleValue(CnameRecord, 'target.foo.com.',
'other.foo.com.') 'other.foo.com.')