mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-09 20:37:46 +00:00
Python3 compatibility
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
from StringIO import StringIO
|
||||
from io import BytesIO
|
||||
|
||||
|
||||
def test_parameter_validation(simple_app):
|
||||
@@ -121,7 +121,7 @@ def test_formdata_missing_param(simple_app):
|
||||
def test_formdata_file_upload(simple_app):
|
||||
app_client = simple_app.app.test_client()
|
||||
resp = app_client.post('/v1.0/test-formData-file-upload',
|
||||
data={'formData': (StringIO('file contents'), 'filename.txt')})
|
||||
data={'formData': (BytesIO(b'file contents'), 'filename.txt')})
|
||||
assert resp.status_code == 200
|
||||
response = json.loads(resp.data.decode())
|
||||
assert response == {'filename.txt': 'file contents'}
|
||||
@@ -138,7 +138,7 @@ def test_formdata_file_upload_bad_request(simple_app):
|
||||
def test_formdata_file_upload_missing_param(simple_app):
|
||||
app_client = simple_app.app.test_client()
|
||||
resp = app_client.post('/v1.0/test-formData-file-upload-missing-param',
|
||||
data={'missing_formData': (StringIO('file contents'), 'example.txt')})
|
||||
data={'missing_formData': (BytesIO(b'file contents'), 'example.txt')})
|
||||
assert resp.status_code == 200
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user