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