소스 검색

fix flask context

Bastien Sevajol 7 년 전
부모
커밋
aac9e15249
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      hapic/ext/flask/context.py
  2. 1 1
      tests/func/fake_api/test_flask.py

+ 1 - 0
hapic/ext/flask/context.py 파일 보기

@@ -106,4 +106,5 @@ class FlaskContext(ContextInterface):
106 106
         return FLASK_RE_PATH_URL.sub(r'{\1}', contextualised_rule)
107 107
 
108 108
     def by_pass_output_wrapping(self, response: typing.Any) -> bool:
109
+        from flask import Response
109 110
         return isinstance(response, Response)

+ 1 - 1
tests/func/fake_api/test_flask.py 파일 보기

@@ -18,7 +18,7 @@ def test_func_flask_fake_api():
18 18
     )
19 19
 
20 20
     assert doc == SWAGGER_DOC_API
21
-    resp = app.get('/about')
21
+    resp = app.get('/about', status='*')
22 22
     assert resp.status_int == 200
23 23
     assert resp.json == {'datetime': '2017-12-07T10:55:08.488996+00:00',
24 24
                          'version': '1.2.3'}