Files
notifications-admin/app/notify_client/status_api_client.py
Chris Hill-Scott 5fda35c89d Make it clear that client do not use __init__
The clients never get passed useful values to their `__init__` methods.
Rather the real values are passed through later using the `init_app`
method.

So it should be an error if the client is relying on the values that
get passed to it’s init method. Easiest way to ensure this is by making
the `__init__` method not expect any arguments and passing fake values
to the `Super` call.
2016-09-12 12:18:19 +01:00

15 lines
470 B
Python

from notifications_python_client.base import BaseAPIClient
class StatusApiClient(BaseAPIClient):
def __init__(self):
super(self.__class__, self).__init__("a", "b", "c")
def init_app(self, app):
self.base_url = app.config['API_HOST_NAME']
self.service_id = app.config['ADMIN_CLIENT_USER_NAME']
self.api_key = app.config['ADMIN_CLIENT_SECRET']
def get_status(self, *params):
return self.get(url='/_status', *params)