openapi-core/tests/unit/schema/test_request_bodies.py

22 lines
553 B
Python
Raw Normal View History

2017-09-21 11:51:37 +00:00
import mock
import pytest
2018-04-17 12:18:40 +00:00
from openapi_core.schema.request_bodies.models import RequestBody
2017-09-21 11:51:37 +00:00
class TestRequestBodies(object):
@pytest.fixture
def request_body(self):
content = {
'application/json': mock.sentinel.application_json,
'text/csv': mock.sentinel.text_csv,
}
return RequestBody(content)
@property
def test_iteritems(self, request_body):
2019-06-18 11:39:07 +00:00
for mimetype in request_body.content:
2017-10-09 14:57:07 +00:00
assert request_body[mimetype] ==\
request_body.content[mimetype]