1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

add tests for DnsMadeEasy provider

This commit is contained in:
Adam Smith
2018-01-27 21:58:05 -08:00
parent 4dc7c582a3
commit d8837a14ad
4 changed files with 531 additions and 9 deletions

View File

@@ -34,12 +34,6 @@ class DnsMadeEasyClientUnauthorized(DnsMadeEasyClientException):
super(DnsMadeEasyClientUnauthorized, self).__init__('Unauthorized')
class DnsMadeEasyClientForbidden(DnsMadeEasyClientException):
def __init__(self):
super(DnsMadeEasyClientForbidden, self).__init__('Forbidden')
class DnsMadeEasyClientNotFound(DnsMadeEasyClientException):
def __init__(self):
@@ -81,10 +75,8 @@ class DnsMadeEasyClient(object):
params=params, json=data)
if resp.status_code == 400:
raise DnsMadeEasyClientBadRequest(resp)
if resp.status_code == 401:
if resp.status_code in [401, 403]:
raise DnsMadeEasyClientUnauthorized()
if resp.status_code == 403:
raise DnsMadeEasyClientForbidden()
if resp.status_code == 404:
raise DnsMadeEasyClientNotFound()
resp.raise_for_status()