Lines Matching refs:parse
3 import urllib.parse
769 result = urllib.parse.quote(do_not_quote)
772 result = urllib.parse.quote_plus(do_not_quote)
778 self.assertEqual(urllib.parse.quote.__defaults__[0], '/')
783 result = urllib.parse.quote(quote_by_default, safe=quote_by_default)
786 result = urllib.parse.quote_plus(quote_by_default,
792 result = urllib.parse.quote(quote_by_default, safe=b"<>")
797 result = urllib.parse.quote("a\xfcb", encoding="latin-1", safe="\xfc")
798 expect = urllib.parse.quote("a\xfcb", encoding="latin-1", safe="")
803 result = urllib.parse.quote("a\xfcb", encoding="latin-1", safe=b"\xfc")
804 expect = urllib.parse.quote("a\xfcb", encoding="latin-1", safe="")
817 result = urllib.parse.quote(char)
822 result = urllib.parse.quote_plus(char)
830 result = urllib.parse.quote(partial_quote)
833 result = urllib.parse.quote_plus(partial_quote)
840 result = urllib.parse.quote(' ')
843 result = urllib.parse.quote_plus(' ')
848 result = urllib.parse.quote(given)
852 result = urllib.parse.quote_plus(given)
857 self.assertEqual(urllib.parse.quote_plus('alpha+beta gamma'),
859 self.assertEqual(urllib.parse.quote_plus('alpha+beta gamma', '+'),
862 self.assertEqual(urllib.parse.quote_plus(b'alpha+beta gamma'),
865 self.assertEqual(urllib.parse.quote_plus('alpha+beta gamma', b'+'),
872 result = urllib.parse.quote(given)
876 self.assertRaises(TypeError, urllib.parse.quote, given,
879 result = urllib.parse.quote_from_bytes(given)
888 result = urllib.parse.quote(given)
892 result = urllib.parse.quote(given, encoding=None, errors=None)
898 result = urllib.parse.quote(given, encoding="latin-1")
904 result = urllib.parse.quote(given)
909 self.assertRaises(UnicodeEncodeError, urllib.parse.quote, given,
914 result = urllib.parse.quote(given, encoding="latin-1",
921 result = urllib.parse.quote(given, encoding="latin-1",
930 result = urllib.parse.quote_plus(given, encoding="latin-1")
936 result = urllib.parse.quote_plus(given, encoding="latin-1",
955 result = urllib.parse.unquote(given)
958 result = urllib.parse.unquote_plus(given)
965 result = urllib.parse.unquote(escape_string)
969 self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, None)
970 self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, ())
972 self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, b'')
978 result = urllib.parse.unquote(given)
983 result = urllib.parse.unquote(given)
988 result = urllib.parse.unquote(given)
994 result = urllib.parse.unquote_to_bytes(given)
999 result = urllib.parse.unquote_to_bytes(given)
1004 result = urllib.parse.unquote_to_bytes(given)
1007 self.assertRaises((TypeError, AttributeError), urllib.parse.unquote_to_bytes, None)
1008 self.assertRaises((TypeError, AttributeError), urllib.parse.unquote_to_bytes, ())
1014 result = urllib.parse.unquote_to_bytes(given)
1024 result = urllib.parse.unquote(given)
1027 result = urllib.parse.unquote_plus(given)
1035 result = urllib.parse.unquote(given)
1039 result = urllib.parse.unquote_plus(given)
1046 result = urllib.parse.unquote_to_bytes(given)
1053 result = urllib.parse.unquote_to_bytes("\u6f22%C3%BC")
1061 result = urllib.parse.unquote_to_bytes(given)
1069 result = urllib.parse.unquote_to_bytes(given)
1078 result = urllib.parse.unquote(given)
1082 result = urllib.parse.unquote(given, encoding=None, errors=None)
1087 result = urllib.parse.unquote('br%FCckner_sapporo_20050930.doc',
1096 result = urllib.parse.unquote(given)
1103 result = urllib.parse.unquote(given)
1108 result = urllib.parse.unquote(given, errors="replace")
1115 result = urllib.parse.unquote(given, errors="ignore")
1120 result = urllib.parse.unquote("\u6f22%C3%BC")
1127 result = urllib.parse.unquote("\u6f22%FC", encoding="latin-1")
1148 result = urllib.parse.urlencode(given)
1181 result = urllib.parse.urlencode(given)
1185 result = urllib.parse.urlencode(given)
1191 expect = "sequence=%s" % urllib.parse.quote_plus(str(['1', '2', '3']))
1192 result = urllib.parse.urlencode(given)
1194 result = urllib.parse.urlencode(given, True)
1202 self.assertEqual("", urllib.parse.urlencode({}))
1203 self.assertEqual("", urllib.parse.urlencode([]))
1206 self.assertEqual("a=1", urllib.parse.urlencode({"a": 1}))
1207 self.assertEqual("a=None", urllib.parse.urlencode({"a": None}))
1210 self.assertEqual("a=1&a=2", urllib.parse.urlencode({"a": [1, 2]}, True))
1212 urllib.parse.urlencode({"a": [None, "a"]}, True))
1215 urllib.parse.urlencode({"a": data}, True))
1221 result = urllib.parse.urlencode(given, encoding="ASCII", errors="replace")
1227 result = urllib.parse.urlencode(given)
1233 result = urllib.parse.urlencode(given, encoding="latin-1")
1240 result = urllib.parse.urlencode(given, doseq=True,
1247 result = urllib.parse.urlencode(given, True,
1254 result = urllib.parse.urlencode(given, True)
1259 result = urllib.parse.urlencode(given, True)
1265 result = urllib.parse.urlencode(given, True, encoding="latin-1")
1270 result = urllib.parse.urlencode(given, True, encoding="latin-1")
1276 result = urllib.parse.urlencode(given)
1278 result = urllib.parse.urlencode(given, True)
1284 result = urllib.parse.urlencode(given, True)
1293 result = urllib.parse.urlencode(given, safe=":$")
1298 result = urllib.parse.urlencode(given, doseq=True, safe=":$")
1305 result = urllib.parse.urlencode(given, True, safe=":$")
1311 result = urllib.parse.urlencode(given, safe=":$",
1318 result = urllib.parse.urlencode(given, doseq=True, safe=":$",
1323 result = urllib.parse.urlencode(given, True, safe=":$",
1347 expect = "needs/%s/here" % urllib.parse.quote("quot=ing")
1358 expect = "%s/using_quote" % urllib.parse.quote("make sure")