|
@@ -1,4 +1,6 @@
|
1
|
1
|
# -*- coding: utf-8 -*-
|
|
2
|
+import json
|
|
3
|
+
|
2
|
4
|
import pytest
|
3
|
5
|
import typing
|
4
|
6
|
|
|
@@ -234,7 +236,7 @@ class TestOutputControllerWrapper(Base):
|
234
|
236
|
# see MyProcessor#process
|
235
|
237
|
assert {
|
236
|
238
|
'http_code': HTTPStatus.OK,
|
237
|
|
- 'original_response': 43,
|
|
239
|
+ 'original_response': '43',
|
238
|
240
|
} == result
|
239
|
241
|
|
240
|
242
|
def test_unit__output_data_wrapping__fail__error_response(self):
|
|
@@ -276,11 +278,11 @@ class TestExceptionHandlerControllerWrapper(Base):
|
276
|
278
|
assert 'http_code' in response
|
277
|
279
|
assert response['http_code'] == HTTPStatus.INTERNAL_SERVER_ERROR
|
278
|
280
|
assert 'original_response' in response
|
279
|
|
- assert response['original_response'] == {
|
|
281
|
+ assert response['original_response'] == json.dumps({
|
280
|
282
|
'message': 'We are testing',
|
281
|
283
|
'code': None,
|
282
|
284
|
'details': {},
|
283
|
|
- }
|
|
285
|
+ })
|
284
|
286
|
|
285
|
287
|
def test_unit__exception_handled__ok__exception_error_dict(self):
|
286
|
288
|
class MyException(Exception):
|
|
@@ -306,11 +308,11 @@ class TestExceptionHandlerControllerWrapper(Base):
|
306
|
308
|
assert 'http_code' in response
|
307
|
309
|
assert response['http_code'] == HTTPStatus.INTERNAL_SERVER_ERROR
|
308
|
310
|
assert 'original_response' in response
|
309
|
|
- assert response['original_response'] == {
|
|
311
|
+ assert response['original_response'] == json.dumps({
|
310
|
312
|
'message': 'We are testing',
|
311
|
313
|
'code': None,
|
312
|
314
|
'details': {'foo': 'bar'},
|
313
|
|
- }
|
|
315
|
+ })
|
314
|
316
|
|
315
|
317
|
def test_unit__exception_handler__error__error_content_malformed(self):
|
316
|
318
|
class MyException(Exception):
|