Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #35 from lendingblock/master
Browse files Browse the repository at this point in the history
0.2.2
  • Loading branch information
lsbardel authored Jul 3, 2018
2 parents ee2e3a8 + ca08d14 commit fbaadf2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion openapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Minimal OpenAPI asynchronous server application
"""
__version__ = '0.2.1'
__version__ = '0.2.2'
2 changes: 1 addition & 1 deletion openapi/exc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ def __init__(self, status=None, **kw):
super().__init__(**kw)
reason = self.reason
if isinstance(reason, str):
reason = {'error': reason}
reason = {'message': reason}
self.text = dumps(reason)
9 changes: 8 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,12 @@ def test_debug_flag():
def test_json_http_exception():
ex = JsonHttpException(status=401)
assert ex.status == 401
assert ex.text == dumps({'error': 'Unauthorized'})
assert ex.text == dumps({'message': 'Unauthorized'})
assert ex.headers['content-type'] == 'application/json; charset=utf-8'


def test_json_http_exception_reason():
ex = JsonHttpException(status=422, reason='non lo so')
assert ex.status == 422
assert ex.text == dumps({'message': 'non lo so'})
assert ex.headers['content-type'] == 'application/json; charset=utf-8'

0 comments on commit fbaadf2

Please sign in to comment.