mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
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.
This commit is contained in:
@@ -9,10 +9,8 @@ KEY_TYPE_TEST = 'test'
|
||||
|
||||
|
||||
class ApiKeyApiClient(BaseAPIClient):
|
||||
def __init__(self, base_url=None, service_id=None, api_key=None):
|
||||
super(self.__class__, self).__init__(base_url=base_url or 'base_url',
|
||||
service_id=service_id or 'service_id',
|
||||
api_key=api_key or 'api_key')
|
||||
def __init__(self):
|
||||
super(self.__class__, self).__init__("a", "b", "c")
|
||||
|
||||
def init_app(self, app):
|
||||
self.base_url = app.config['API_HOST_NAME']
|
||||
|
||||
Reference in New Issue
Block a user