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:
@@ -7,9 +7,9 @@ from __future__ import absolute_import, division, print_function, \
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from octodns.record import ARecord, AaaaRecord, CnameRecord, Create, Delete, \
|
||||
GeoValue, MxRecord, NaptrRecord, NaptrValue, NsRecord, PtrRecord, Record, \
|
||||
SshfpRecord, SpfRecord, SrvRecord, TxtRecord, Update
|
||||
from octodns.record import ARecord, AaaaRecord, AliasRecord, CnameRecord, \
|
||||
Create, Delete, GeoValue, MxRecord, NaptrRecord, NaptrValue, NsRecord, \
|
||||
PtrRecord, Record, SshfpRecord, SpfRecord, SrvRecord, TxtRecord, Update
|
||||
from octodns.zone import Zone
|
||||
|
||||
from helpers import GeoProvider, SimpleProvider
|
||||
@@ -242,6 +242,17 @@ class TestRecord(TestCase):
|
||||
# __repr__ doesn't blow up
|
||||
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):
|
||||
self.assertSingleValue(CnameRecord, 'target.foo.com.',
|
||||
'other.foo.com.')
|
||||
|
Reference in New Issue
Block a user