mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-22 03:00:10 +00:00
Falcon2 for python2 tests
This commit is contained in:
parent
2c864595e5
commit
74d49d19a3
3 changed files with 6 additions and 5 deletions
|
@ -2,7 +2,8 @@ mock==2.0.0
|
|||
pytest==3.5.0
|
||||
pytest-flake8
|
||||
pytest-cov==2.5.1
|
||||
falcon==3.0.0
|
||||
falcon==2.0.0; python_version<"3.0"
|
||||
falcon==3.0.0; python_version>="3.0"
|
||||
flask
|
||||
django==2.2.18; python_version>="3.0"
|
||||
requests==2.22.0
|
||||
|
|
|
@ -43,7 +43,7 @@ def response_factory(environ_factory):
|
|||
data, status_code=200, content_type='application/json'):
|
||||
options = ResponseOptions()
|
||||
resp = Response(options)
|
||||
resp.text = data
|
||||
resp.body = data
|
||||
resp.content_type = content_type
|
||||
resp.status = HTTP_200
|
||||
return resp
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from json import dumps
|
||||
|
||||
from falcon import App
|
||||
from falcon import API as App
|
||||
from falcon.testing import TestClient
|
||||
import pytest
|
||||
|
||||
|
@ -67,7 +67,7 @@ class TestFalconOpenAPIMiddleware(object):
|
|||
})
|
||||
response.content_type = MEDIA_HTML
|
||||
response.status = HTTP_200
|
||||
response.text = 'success'
|
||||
response.body = 'success'
|
||||
self.view_response_callable = view_response_callable
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
result = client.simulate_get(
|
||||
|
@ -190,7 +190,7 @@ class TestFalconOpenAPIMiddleware(object):
|
|||
})
|
||||
response.status = HTTP_200
|
||||
response.content_type = MEDIA_JSON
|
||||
response.text = dumps({
|
||||
response.body = dumps({
|
||||
'data': 'data',
|
||||
})
|
||||
self.view_response_callable = view_response_callable
|
||||
|
|
Loading…
Reference in a new issue