diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-07-30 14:24:39 +0200 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-07-30 14:26:49 +0200 |
commit | 1b6cc7e5c5a22eea4d781bbb846519a6051d2a5f (patch) | |
tree | a565dded3160db4c06d1c570b44dbc9c4a47cb0e /app/handlers/response.py | |
parent | 3b8f7e49c065c87abd2a8703a95a5c297b923cb4 (diff) |
HandlerResponse: Rework constructur, add tests.
* Rework the constructor to accept only one parameter.
* Add tests.
Change-Id: I560b303e42cbc1c23a2b4c41e117c6bbda6f76d8
Diffstat (limited to 'app/handlers/response.py')
-rw-r--r-- | app/handlers/response.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/handlers/response.py b/app/handlers/response.py index 68d8af8..75c358d 100644 --- a/app/handlers/response.py +++ b/app/handlers/response.py @@ -28,13 +28,13 @@ class HandlerResponse(object): This might be used to pass custom message or set custom headers after an action has been performed. """ - def __init__(self, status_code, message=None, headers=None): + def __init__(self, status_code): + if not isinstance(status_code, IntType): + raise ValueError("Value must be an integer") + self._status_code = status_code - self._message = message - if headers: - self._headers = headers - else: - self._headers = {} + self._message = None + self._headers = {} @property def status_code(self): |