Corrected the Content-Type header for /basePath/swagger.json to return application/json and added a test for that

This commit is contained in:
jkozlowicz
2016-06-06 14:21:15 +02:00
parent d39bbd1547
commit bd25c5ca74
2 changed files with 11 additions and 1 deletions

View File

@@ -72,6 +72,14 @@ def test_no_swagger_json_api(simple_api_spec_dir):
assert swagger_json.status_code == 404
def test_swagger_json_content_type(simple_app):
app_client = simple_app.app.test_client()
response = app_client.get('/v1.0/swagger.json', data={}) # type: flask.Response
assert response.status_code == 200
assert response.content_type == 'application/json'
def test_single_route(simple_app):
def route1():
return 'single 1'