mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
Set up clients wrapper to hold all the clients
- tests FAIL if there is a provider in the DB and not in the CODE - tests PASS is there a provider in the CODE and not in the DB
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
class ClientException(Exception):
|
||||
'''
|
||||
Base Exceptions for sending notifications that fail
|
||||
@@ -16,3 +15,21 @@ class Client(object):
|
||||
STATISTICS_REQUESTED = 'requested'
|
||||
STATISTICS_DELIVERED = 'delivered'
|
||||
STATISTICS_FAILURE = 'failure'
|
||||
|
||||
|
||||
class Clients(object):
|
||||
sms_clients = {}
|
||||
email_clients = {}
|
||||
|
||||
def init_app(self, sms_clients, email_clients):
|
||||
for client in sms_clients:
|
||||
self.sms_clients[client.name] = client
|
||||
|
||||
for client in email_clients:
|
||||
self.email_clients[client.name] = client
|
||||
|
||||
def sms_client(self, name):
|
||||
return self.sms_clients.get(name)
|
||||
|
||||
def email_client(self, name):
|
||||
return self.email_clients.get(name)
|
||||
|
||||
Reference in New Issue
Block a user