mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
add contents for alias method, test for alias
This commit is contained in:
@@ -73,7 +73,7 @@ class UltraProvider(BaseProvider):
|
||||
SUPPORTS_GEO = False
|
||||
SUPPORTS_DYNAMIC = False
|
||||
TIMEOUT = 5
|
||||
ZONE_REQUEST_LIMIT = 1000
|
||||
ZONE_REQUEST_LIMIT = 100
|
||||
|
||||
def _request(self, method, path, params=None,
|
||||
data=None, json=None, json_response=True):
|
||||
@@ -213,6 +213,7 @@ class UltraProvider(BaseProvider):
|
||||
|
||||
_data_for_PTR = _data_for_single
|
||||
_data_for_CNAME = _data_for_single
|
||||
_data_for_ALIAS = _data_for_single
|
||||
|
||||
def _data_for_CAA(self, _type, records):
|
||||
return {
|
||||
@@ -376,6 +377,7 @@ class UltraProvider(BaseProvider):
|
||||
}
|
||||
|
||||
_contents_for_PTR = _contents_for_CNAME
|
||||
_contents_for_ALIAS = _contents_for_CNAME
|
||||
|
||||
def _contents_for_SRV(self, record):
|
||||
return {
|
||||
|
||||
@@ -274,7 +274,7 @@ class TestUltraProvider(TestCase):
|
||||
|
||||
self.assertTrue(provider.populate(zone))
|
||||
self.assertEquals('octodns1.test.', zone.name)
|
||||
self.assertEquals(11, len(zone.records))
|
||||
self.assertEquals(12, len(zone.records))
|
||||
self.assertEquals(4, mock.call_count)
|
||||
|
||||
def test_apply(self):
|
||||
@@ -352,8 +352,8 @@ class TestUltraProvider(TestCase):
|
||||
}))
|
||||
|
||||
plan = provider.plan(wanted)
|
||||
self.assertEquals(10, len(plan.changes))
|
||||
self.assertEquals(10, provider.apply(plan))
|
||||
self.assertEquals(11, len(plan.changes))
|
||||
self.assertEquals(11, provider.apply(plan))
|
||||
self.assertTrue(plan.exists)
|
||||
|
||||
provider._request.assert_has_calls([
|
||||
@@ -492,6 +492,15 @@ class TestUltraProvider(TestCase):
|
||||
Record.new(zone, 'txt',
|
||||
{'ttl': 60, 'type': 'TXT',
|
||||
'values': ['abc', 'def']})),
|
||||
|
||||
# ALIAS
|
||||
('', 'ALIAS',
|
||||
'/v2/zones/unit.tests./rrsets/APEXALIAS/unit.tests.',
|
||||
{'ttl': 60, 'rdata': ['target.unit.tests.']},
|
||||
Record.new(zone, '',
|
||||
{'ttl': 60, 'type': 'ALIAS',
|
||||
'value': 'target.unit.tests.'})),
|
||||
|
||||
):
|
||||
# Validate path and payload based on record meet expectations
|
||||
path, payload = provider._gen_data(expected_record)
|
||||
|
||||
Reference in New Issue
Block a user