Pass along exceptions related to user mistakes

This commit is contained in:
Rafael Caricio
2016-09-13 12:00:41 +02:00
parent 3f33a54ec3
commit ccce2f85fe
4 changed files with 32 additions and 0 deletions

View File

@@ -39,6 +39,9 @@ def test_invalid_operation_does_stop_application_to_setup():
with pytest.raises(ResolverError):
Api(TEST_FOLDER / "fixtures/missing_op_id/swagger.yaml", "/api/v1.0",
{'title': 'OK'})
with pytest.raises(ValueError):
Api(TEST_FOLDER / "fixtures/user_module_loading_error/swagger.yaml", "/api/v1.0",
{'title': 'OK'})
def test_invalid_operation_does_not_stop_application_in_debug_mode():
@@ -50,6 +53,10 @@ def test_invalid_operation_does_not_stop_application_in_debug_mode():
{'title': 'OK'}, debug=True)
assert api.specification['info']['title'] == 'OK'
api = Api(TEST_FOLDER / "fixtures/user_module_loading_error/swagger.yaml", "/api/v1.0",
{'title': 'OK'}, debug=True)
assert api.specification['info']['title'] == 'OK'
def test_invalid_schema_file_structure():
with pytest.raises(SwaggerValidationError):