Added base object for response statuses, and tests around it's behaviour

This commit is contained in:
Martyn Inglis
2016-03-21 09:20:38 +00:00
parent 86579fba71
commit e2cfbce8c4
6 changed files with 133 additions and 61 deletions

View File

@@ -11,3 +11,24 @@ class Client(object):
Base client for sending notifications.
'''
pass
class ClientResponse:
def __init__(self):
self.__response_model__ = None
def response_code_to_object(self, response_code):
return self.__response_model__[response_code]
def response_code_to_message(self, response_code):
return self.response_code_to_object(response_code)['message']
def response_code_to_notification_status(self, response_code):
print(response_code)
return self.response_code_to_object(response_code)['notification_status']
def response_code_to_notification_statistics_status(self, response_code):
return self.response_code_to_object(response_code)['notification_statistics_status']
def response_code_to_notification_success(self, response_code):
return self.response_code_to_object(response_code)['success']