def test_partial_path_match(): assert partial_path_match('/v1/bing/forward_unstructured', '/v1/bing/forward_unstructured') assert partial_path_match('/v1/{api_provider}/forward_unstructured', '/v1/bing/forward_unstructured') assert not partial_path_match('/v1/google/forward_unstructured', '/v1/bing/forward_unstructured')
def test_partial_path_match(): assert partial_path_match( '/v1/bing/forward_unstructured', '/v1/bing/forward_unstructured' ) assert partial_path_match( '/v1/{api_provider}/forward_unstructured', '/v1/bing/forward_unstructured' ) assert not partial_path_match( '/v1/google/forward_unstructured', '/v1/bing/forward_unstructured' )
def matches(self, request): """ :param request: a :class:`pyramid.request.Request` :returns: True if this matcher matches the request, False otherwise """ return partial_path_match(request.path_info, self.path) and request.method == self.method
def matches(self, request): """ :param request: a :class:`pyramid.request.Request` :returns: True if this matcher matches the request, False otherwise """ return ( partial_path_match(request.path_info, self.path) and request.method == self.method )