2017-09-21 12:51:37 +01:00
|
|
|
import mock
|
|
|
|
import pytest
|
|
|
|
|
2018-04-17 13:18:40 +01:00
|
|
|
from openapi_core.schema.schemas.models import Schema
|
2018-08-22 11:51:06 +01:00
|
|
|
|
2017-09-21 12:51:37 +01:00
|
|
|
|
2017-10-17 14:02:21 +01:00
|
|
|
class TestSchemaIteritems(object):
|
2017-09-21 12:51:37 +01: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 14:02:21 +01:00
|
|
|
def test_valid(self, schema):
|
2019-06-18 12:39:07 +01:00
|
|
|
for name in schema.properties:
|
2017-09-21 12:51:37 +01:00
|
|
|
assert schema[name] == schema.properties[name]
|