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
         return FLASK_RE_PATH_URL.sub(r'{\1}', contextualised_rule)
106
         return FLASK_RE_PATH_URL.sub(r'{\1}', contextualised_rule)
107
 
107
 
108
     def by_pass_output_wrapping(self, response: typing.Any) -> bool:
108
     def by_pass_output_wrapping(self, response: typing.Any) -> bool:
109
+        from flask import Response
109
         return isinstance(response, Response)
110
         return isinstance(response, Response)

+ 1 - 1
tests/func/fake_api/test_flask.py Целия файл

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