Skip to content

Commit

Permalink
Errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
31z4 committed Sep 29, 2016
1 parent 58da2b3 commit 1fb776e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion connexion/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(self, swagger_yaml_path, base_url=None, arguments=None,

# A list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific
# API calls.
self.produces = self.specification.get('produces', ['application/json']) # type: List[str]
self.produces = self.specification.get('produces', list()) # type: List[str]

# A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific
# API calls.
Expand Down
5 changes: 1 addition & 4 deletions tests/api/test_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,5 @@ def test_bad_operations(bad_operations_app):
def test_text_request(simple_app):
app_client = simple_app.app.test_client()

resp = app_client.post('/v1.0/text-request', data=u'text')
resp = app_client.post('/v1.0/text-request', data='text')
assert resp.status_code == 200
assert resp.content_type == 'text/plain; charset=utf-8'
# validate text content
assert resp.data == u'text'
2 changes: 1 addition & 1 deletion tests/fakeapi/hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def get_data_as_binary():


def get_data_as_text(post_param):
return post_param, 200, {'Content-Type': 'text/plain; charset=utf-8'}
return ''


def get_invalid_response():
Expand Down
6 changes: 1 addition & 5 deletions tests/fixtures/simple/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,6 @@ paths:
operationId: fakeapi.hello.get_data_as_text
consumes:
- "text/plain"
produces:
- "text/plain"
parameters:
- name: post_param
description: Just a testing parameter.
Expand All @@ -646,9 +644,7 @@ paths:
type: string
responses:
200:
description: Everything is ok
schema:
type: string
description: OK


definitions:
Expand Down

0 comments on commit 1fb776e

Please sign in to comment.