def test_merge_slash_encoding(path, expected):
    """This test is to make sure URLs are not double-encoded
    when a redirect is thrown with `merge_slash = True`"""
    url_map = r.Map(
        [
            r.Rule("/merge/<some>/path"),
        ]
    )
    adapter = url_map.bind("localhost", "/")

    with pytest.raises(r.RequestRedirect) as excinfo:
        adapter.match(path)

    assert excinfo.value.new_url.endswith(expected)
This test is to make sure URLs are not double-encoded
    when a redirect is thrown with `merge_slash = True`
tests/test_routing.py