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

21 lines
508 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.schemas.models import Schema
2018-08-22 10:51:06 +00:00
2017-09-21 11:51:37 +00:00
2017-10-17 13:02:21 +00:00
class TestSchemaIteritems(object):
2017-09-21 11:51:37 +00:00
@pytest.fixture
def schema(self):
properties = {
'application/json': mock.sentinel.application_json,
'text/csv': mock.sentinel.text_csv,
}
return Schema('object', properties=properties)
@property
2017-10-17 13:02:21 +00:00
def test_valid(self, schema):
2019-06-18 11:39:07 +00:00
for name in schema.properties:
2017-09-21 11:51:37 +00:00
assert schema[name] == schema.properties[name]