Esempio n. 1
0
 def path_components(self):
     """
     The URL's path components as a tuple of strings.
     Components are unquoted.
     """
     path = urllib.parse.urlparse(self.url).path
     # This needs to be a tuple so that it's immutable.
     # Otherwise, this would fail silently:
     #   request.path_components.append("foo")
     return tuple(url.unquote(i) for i in path.split("/") if i)
Esempio n. 2
0
def test_unquote():
    assert url.unquote("foo") == "foo"
    assert url.unquote("foo%20bar") == "foo bar"
    assert url.unquote(surrogates_quoted) == surrogates
Esempio n. 3
0
def test_unquote():
    assert url.unquote("foo") == "foo"
    assert url.unquote("foo%20bar") == "foo bar"
    assert url.unquote(surrogates_quoted) == surrogates