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

22 lines
485 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.paths.models import Path
2017-09-21 11:51:37 +00:00
class TestPaths(object):
@pytest.fixture
def path(self):
operations = {
'get': mock.sentinel.get,
'post': mock.sentinel.post,
}
return Path('/path', operations)
@property
def test_iteritems(self, path):
for http_method in path.operations.keys():
assert path[http_method] ==\
path.operations[http_method]