Пример #1
0
def test_quote():
    assert url.quote("foo") == "foo"
    assert url.quote("foo bar") == "foo%20bar"
    assert url.quote(surrogates) == surrogates_quoted
Пример #2
0
 def path_components(self, components):
     components = map(lambda x: url.quote(x, safe=""), components)
     path = "/" + "/".join(components)
     _, _, _, params, query, fragment = urllib.parse.urlparse(self.url)
     self.path = urllib.parse.urlunparse(
         ["", "", path, params, query, fragment])
Пример #3
0
def test_quote():
    assert url.quote("foo") == "foo"
    assert url.quote("foo bar") == "foo%20bar"
    assert url.quote(surrogates) == surrogates_quoted