2017-09-21 11:51:37 +00:00
|
|
|
import mock
|
|
|
|
import pytest
|
|
|
|
|
2018-04-17 12:18:40 +00:00
|
|
|
from openapi_core.schema.operations.models import Operation
|
2017-09-21 11:51:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestSchemas(object):
|
|
|
|
|
|
|
|
@pytest.fixture
|
2017-11-06 11:19:18 +00:00
|
|
|
def operation(self):
|
2017-09-21 11:51:37 +00:00
|
|
|
parameters = {
|
|
|
|
'parameter_1': mock.sentinel.parameter_1,
|
|
|
|
'parameter_2': mock.sentinel.parameter_2,
|
|
|
|
}
|
2017-11-06 11:19:18 +00:00
|
|
|
return Operation('get', '/path', {}, parameters=parameters)
|
2017-09-21 11:51:37 +00:00
|
|
|
|
2017-11-06 11:19:18 +00:00
|
|
|
def test_iteritems(self, operation):
|
2019-06-18 11:39:07 +00:00
|
|
|
for name in operation.parameters:
|
2017-11-06 11:19:18 +00:00
|
|
|
assert operation[name] == operation.parameters[name]
|