mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
MX record values are repesented by a sub-struct.
This commit is contained in:
@@ -337,9 +337,9 @@ class RackspaceProvider(BaseProvider):
|
|||||||
return {
|
return {
|
||||||
'name': remove_trailing_dot(record.fqdn),
|
'name': remove_trailing_dot(record.fqdn),
|
||||||
'type': record._type,
|
'type': record._type,
|
||||||
'data': remove_trailing_dot(value),
|
'data': remove_trailing_dot(value.value),
|
||||||
'ttl': max(record.ttl, 300),
|
'ttl': max(record.ttl, 300),
|
||||||
'priority': record.priority
|
'priority': value.priority
|
||||||
}
|
}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -342,6 +342,57 @@ class TestRackspaceProvider(TestCase):
|
|||||||
ExpectedUpdates = None
|
ExpectedUpdates = None
|
||||||
return self._test_apply_with_data(TestData)
|
return self._test_apply_with_data(TestData)
|
||||||
|
|
||||||
|
def test_apply_create_MX(self):
|
||||||
|
class TestData(object):
|
||||||
|
OtherRecords = [
|
||||||
|
{
|
||||||
|
"subdomain": '',
|
||||||
|
"data": {
|
||||||
|
'type': 'MX',
|
||||||
|
'ttl': 300,
|
||||||
|
'value': {
|
||||||
|
'value': 'mail1.example.com.',
|
||||||
|
'priority': 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"subdomain": 'foo',
|
||||||
|
"data": {
|
||||||
|
'type': 'MX',
|
||||||
|
'ttl': 300,
|
||||||
|
'value': {
|
||||||
|
'value': 'mail2.example.com.',
|
||||||
|
'priority': 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
OwnRecords = {
|
||||||
|
"totalEntries": 0,
|
||||||
|
"records": []
|
||||||
|
}
|
||||||
|
ExpectChanges = True
|
||||||
|
ExpectedAdditions = {
|
||||||
|
"records": [{
|
||||||
|
"name": "foo.unit.tests",
|
||||||
|
"type": "MX",
|
||||||
|
"data": "mail2.example.com",
|
||||||
|
"priority": 2,
|
||||||
|
"ttl": 300
|
||||||
|
}, {
|
||||||
|
"name": "unit.tests",
|
||||||
|
"type": "MX",
|
||||||
|
"data": "mail1.example.com",
|
||||||
|
"priority": 1,
|
||||||
|
"ttl": 300
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
ExpectedDeletions = None
|
||||||
|
ExpectedUpdates = None
|
||||||
|
return self._test_apply_with_data(TestData)
|
||||||
|
|
||||||
|
|
||||||
def test_apply_multiple_additions_exploding(self):
|
def test_apply_multiple_additions_exploding(self):
|
||||||
class TestData(object):
|
class TestData(object):
|
||||||
OtherRecords = [
|
OtherRecords = [
|
||||||
|
|||||||
Reference in New Issue
Block a user