def test_path_to_regex_conversion_for_non_parametrized_paths(path):
    regex = path_to_regex(path, [])
    assert regex.match(path)
Exemplo n.º 2
0
def get_path_parameter_values(target_path, api_path, path_parameters, context):
    raw_values = path_to_regex(
        api_path,
        path_parameters,
    ).match(target_path).groupdict()
    return type_cast_parameters(raw_values, path_parameters, context=context)
def test_path_to_regex_does_not_overmatch(path, bad_path):
    regex = path_to_regex(path, [])
    assert not regex.match(bad_path)
Exemplo n.º 4
0
def get_path_parameter_values(target_path, api_path, path_parameters, context):
    raw_values = path_to_regex(
        api_path,
        path_parameters,
    ).match(target_path).groupdict()
    return type_cast_parameters(raw_values, path_parameters, context=context)