parent
de3d2b1cb1
commit
7fc53ae78a
@ -144,8 +144,9 @@ class UrlPattern:
|
||||
if parsed.path == '/*':
|
||||
self._path = None
|
||||
elif parsed.path == '':
|
||||
# We want to make it possible to leave off a trailing slash.
|
||||
self._path = '/'
|
||||
# When the user doesn't add a trailing slash, we assume the pattern
|
||||
# matches any path.
|
||||
self._path = None
|
||||
else:
|
||||
self._path = parsed.path
|
||||
|
||||
|
@ -112,6 +112,16 @@ def test_port(pattern, port):
|
||||
assert up._port == port
|
||||
|
||||
|
||||
@pytest.mark.parametrize('pattern, path', [
|
||||
("http://foo/", '/'),
|
||||
("http://foo", None),
|
||||
("http://foo/*", None),
|
||||
])
|
||||
def test_parse_path(pattern, path):
|
||||
up = urlmatch.UrlPattern(pattern)
|
||||
assert up._path == path
|
||||
|
||||
|
||||
class TestMatchAllPagesForGivenScheme:
|
||||
|
||||
@pytest.fixture
|
||||
|
Loading…
Reference in New Issue
Block a user