openapi-core/tests/unit/templating/test_util.py

25 lines
548 B
Python
Raw Normal View History

from openapi_core.templating.util import search
class TestSearch:
def test_endswith(self):
path_patter = '/{test}/test'
full_url_pattern = '/test1/test/test2/test'
result = search(path_patter, full_url_pattern)
assert result.named == {
'test': 'test2',
}
def test_exact(self):
path_patter = '/{test}/test'
full_url_pattern = '/test/test'
result = search(path_patter, full_url_pattern)
assert result.named == {
'test': 'test',
}