Skip to content

Commit

Permalink
Fix test_blueprint_arguments_files_multipart
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Sep 19, 2019
1 parent ab0b98d commit ec28e51
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ class MultipartSchema(ma.Schema):
@blp.route('/', methods=['POST'])
@blp.arguments(MultipartSchema, location='files')
def func(files):
return jsonify(
files['file_1'].read().decode(),
files['file_2'].read().decode(),
)
return {
'file_1': files['file_1'].read().decode(),
'file_2': files['file_2'].read().decode(),
}

api.register_blueprint(blp)
spec = api.spec.to_dict()
Expand All @@ -309,7 +309,7 @@ def func(files):
}

response = client.post('/test/', data=files)
assert response.json == ['Test 1', 'Test 2']
assert response.json == {'file_1': 'Test 1', 'file_2': 'Test 2'}

if openapi_version == '2.0':
for param in spec['paths']['/test/']['post']['parameters']:
Expand Down

0 comments on commit ec28e51

Please sign in to comment.