ソースを参照

fix tests for prevent dict key order mix

Bastien Sevajol 6 年 前
コミット
42591e743b
共有1 個のファイルを変更した4 個の追加4 個の削除を含む
  1. 4 4
      tests/unit/test_decorator.py

+ 4 - 4
tests/unit/test_decorator.py ファイルの表示

278
         assert 'http_code' in response
278
         assert 'http_code' in response
279
         assert response['http_code'] == HTTPStatus.INTERNAL_SERVER_ERROR
279
         assert response['http_code'] == HTTPStatus.INTERNAL_SERVER_ERROR
280
         assert 'original_response' in response
280
         assert 'original_response' in response
281
-        assert response['original_response'] == json.dumps({
281
+        assert json.loads(response['original_response']) == {
282
             'message': 'We are testing',
282
             'message': 'We are testing',
283
             'details': {},
283
             'details': {},
284
             'code': None,
284
             'code': None,
285
-        })
285
+        }
286
 
286
 
287
     def test_unit__exception_handled__ok__exception_error_dict(self):
287
     def test_unit__exception_handled__ok__exception_error_dict(self):
288
         class MyException(Exception):
288
         class MyException(Exception):
308
         assert 'http_code' in response
308
         assert 'http_code' in response
309
         assert response['http_code'] == HTTPStatus.INTERNAL_SERVER_ERROR
309
         assert response['http_code'] == HTTPStatus.INTERNAL_SERVER_ERROR
310
         assert 'original_response' in response
310
         assert 'original_response' in response
311
-        assert response['original_response'] == json.dumps({
311
+        assert json.loads(response['original_response']) == {
312
             'message': 'We are testing',
312
             'message': 'We are testing',
313
             'details': {'foo': 'bar'},
313
             'details': {'foo': 'bar'},
314
             'code': None,
314
             'code': None,
315
-        })
315
+        }
316
 
316
 
317
     def test_unit__exception_handler__error__error_content_malformed(self):
317
     def test_unit__exception_handler__error__error_content_malformed(self):
318
         class MyException(Exception):
318
         class MyException(Exception):