mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
ValueMixin._data always includes 'value'
This commit is contained in:
@@ -374,8 +374,7 @@ class ValueMixin(object):
|
||||
|
||||
def _data(self):
|
||||
ret = super()._data()
|
||||
if self.value:
|
||||
ret['value'] = getattr(self.value, 'data', self.value)
|
||||
ret['value'] = getattr(self.value, 'data', self.value)
|
||||
return ret
|
||||
|
||||
@property
|
||||
|
||||
@@ -225,13 +225,13 @@ class TestRecord(TestCase):
|
||||
a = AliasRecord(
|
||||
self.zone, '', {'type': 'ALIAS', 'ttl': 600, 'value': None}
|
||||
)
|
||||
self.assertNotIn('value', a.data)
|
||||
self.assertIsNone(a.data['value'])
|
||||
|
||||
# unspecified value, no value in data
|
||||
a = AliasRecord(
|
||||
self.zone, '', {'type': 'ALIAS', 'ttl': 600, 'value': ''}
|
||||
)
|
||||
self.assertNotIn('value', a.data)
|
||||
self.assertIsNone(a.data['value'])
|
||||
|
||||
def test_record_new(self):
|
||||
txt = Record.new(
|
||||
@@ -349,6 +349,16 @@ class TestRecord(TestCase):
|
||||
dup = txt.copy()
|
||||
self.assertEqual(txt.values, dup.values)
|
||||
|
||||
cname = Record.new(
|
||||
self.zone,
|
||||
'cname',
|
||||
{'ttl': 45, 'type': 'CNAME', 'value': ''},
|
||||
lenient=True,
|
||||
)
|
||||
|
||||
dup = cname.copy()
|
||||
self.assertEqual(cname.value, dup.value)
|
||||
|
||||
def test_change(self):
|
||||
existing = Record.new(
|
||||
self.zone, 'txt', {'ttl': 44, 'type': 'TXT', 'value': 'some text'}
|
||||
|
||||
Reference in New Issue
Block a user