def test_quote(): assert url.quote("foo") == "foo" assert url.quote("foo bar") == "foo%20bar" assert url.quote(surrogates) == surrogates_quoted
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])