Skip to content

Commit

Permalink
Merge pull request #19 from octodns/supports-root-ns
Browse files Browse the repository at this point in the history
Add SUPPORTS_ROOT_NS to enable mangement of root NS records
  • Loading branch information
ross authored Oct 16, 2023
2 parents f0ef87d + 4a3c521 commit fba9780
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.0.3 - 2023-??-?? -

* Add SUPPORTS_ROOT_NS to enable mangement of root NS records

## v0.0.2 - 2023-02-15 - Support the filter of weight

* Added filter support with type "weighted_shuffle"
Expand Down
1 change: 1 addition & 0 deletions octodns_edgecenter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def _build_url(base, *items):
class _BaseProvider(BaseProvider):
SUPPORTS_GEO = False
SUPPORTS_DYNAMIC = True
SUPPORTS_ROOT_NS = True
SUPPORTS = set(("A", "AAAA", "NS", "MX", "TXT", "SRV", "CNAME", "PTR"))

def __init__(self, id, api_url, auth_url, *args, **kwargs):
Expand Down
17 changes: 14 additions & 3 deletions tests/test_octodns_provider_edgecenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def test_apply(self):
plan = provider.plan(self.expected)

# TC: create all
self.assertEqual(13, len(plan.changes))
self.assertEqual(13, provider.apply(plan))
self.assertEqual(14, len(plan.changes))
self.assertEqual(14, provider.apply(plan))
self.assertFalse(plan.exists)

provider._client._request.assert_has_calls(
Expand All @@ -258,6 +258,17 @@ def test_apply(self):
],
},
),
call(
'POST',
'http://api/zones/unit.tests/unit.tests./NS',
data={
'ttl': 300,
'resource_records': [
{'content': ['ns1.edgedns.ru.']},
{'content': ['ns2.edgedns.ru.']},
],
},
),
call(
"POST",
"http://api/zones/unit.tests/_imap._tcp.unit.tests./SRV",
Expand Down Expand Up @@ -383,7 +394,7 @@ def test_apply(self):
]
)
# expected number of total calls
self.assertEqual(16, provider._client._request.call_count)
self.assertEqual(17, provider._client._request.call_count)

# TC: delete 1 and update 1
provider._client._request.reset_mock()
Expand Down

0 comments on commit fba9780

Please sign in to comment.