openapi-core/openapi_core/testing/responses.py

14 lines
376 B
Python
Raw Normal View History

2020-01-17 14:20:20 +00:00
"""OpenAPI core testing responses module"""
from openapi_core.validation.response.datatypes import OpenAPIResponse
class MockResponseFactory(object):
@classmethod
def create(cls, data, status_code=200, mimetype='application/json'):
return OpenAPIResponse(
data=data,
status_code=status_code,
mimetype=mimetype,
)