Lines Matching refs:urllib
4 import urllib.parse
86 result = urllib.parse.urlparse(url)
92 result2 = urllib.parse.urlunparse(result)
98 result3 = urllib.parse.urlparse(result.geturl())
113 result = urllib.parse.urlsplit(url)
118 result2 = urllib.parse.urlunsplit(result)
123 result3 = urllib.parse.urlsplit(result.geturl())
138 result = urllib.parse.parse_qsl(orig, keep_blank_values=True)
141 result = urllib.parse.parse_qsl(orig, keep_blank_values=False)
147 result = urllib.parse.parse_qs(orig, keep_blank_values=True)
151 result = urllib.parse.parse_qs(orig, keep_blank_values=False)
230 self.assertEqual(urllib.parse.urljoin(base, relurl), expected)
233 self.assertEqual(urllib.parse.urljoin(baseb, relurlb), expectedb)
239 self.assertEqual(urllib.parse.urlunsplit(urllib.parse.urlsplit(u)), u)
240 self.assertEqual(urllib.parse.urlunparse(urllib.parse.urlparse(u)), u)
292 self.assertEqual(urllib.parse.urlparse('mailto:1337@example.org'),
489 urlparsed = urllib.parse.urlparse(url)
500 self.assertRaises(ValueError, urllib.parse.urlparse, invalid_url)
519 result = urllib.parse.urldefrag(url)
526 p = urllib.parse.urlsplit('http://[FE80::822a:a8ff:fe49:470c%tESt]:1234')
530 p = urllib.parse.urlsplit(b'http://[FE80::822a:a8ff:fe49:470c%tESt]:1234')
536 p = urllib.parse.urlsplit(url)
552 p = urllib.parse.urlsplit(url)
569 p = urllib.parse.urlsplit(url)
583 p = urllib.parse.urlsplit(url)
596 p = urllib.parse.urlsplit(url)
609 p = urllib.parse.urlsplit(url)
623 p = urllib.parse.urlsplit(url)
630 for parse in (urllib.parse.urlsplit, urllib.parse.urlparse):
650 p = urllib.parse.urlsplit(uri)
658 p = urllib.parse.urlparse(uri)
668 p = urllib.parse.urlsplit(uri)
676 p = urllib.parse.urlparse(uri)
686 self.assertEqual(urllib.parse.urlparse("http://example.com?blahblah=/foo"),
688 self.assertEqual(urllib.parse.urlparse(b"http://example.com?blahblah=/foo"),
696 self.assertEqual(urllib.parse.urlparse("path"),
698 self.assertEqual(urllib.parse.urlparse("//www.python.org:80"),
700 self.assertEqual(urllib.parse.urlparse("http://www.python.org:80"),
703 self.assertEqual(urllib.parse.urlparse(b"path"),
705 self.assertEqual(urllib.parse.urlparse(b"//www.python.org:80"),
707 self.assertEqual(urllib.parse.urlparse(b"http://www.python.org:80"),
712 self.assertEqual(urllib.parse.urlparse("http:80"), ('http','','80','','',''))
713 self.assertEqual(urllib.parse.urlparse("https:80"), ('https','','80','','',''))
714 self.assertEqual(urllib.parse.urlparse("path:80"), ('path','','80','','',''))
715 self.assertEqual(urllib.parse.urlparse("http:"),('http','','','','',''))
716 self.assertEqual(urllib.parse.urlparse("https:"),('https','','','','',''))
717 self.assertEqual(urllib.parse.urlparse("http://www.python.org:80"),
720 self.assertEqual(urllib.parse.urlparse(b"http:80"), (b'http',b'',b'80',b'',b'',b''))
721 self.assertEqual(urllib.parse.urlparse(b"https:80"), (b'https',b'',b'80',b'',b'',b''))
722 self.assertEqual(urllib.parse.urlparse(b"path:80"), (b'path',b'',b'80',b'',b'',b''))
723 self.assertEqual(urllib.parse.urlparse(b"http:"),(b'http',b'',b'',b'',b'',b''))
724 self.assertEqual(urllib.parse.urlparse(b"https:"),(b'https',b'',b'',b'',b'',b''))
725 self.assertEqual(urllib.parse.urlparse(b"http://www.python.org:80"),
730 self.assertRaises(TypeError, urllib.parse.urlencode, "foo")
734 self.assertEqual(urllib.parse.urlparse("s3://foo.com/stuff"),
736 self.assertEqual(urllib.parse.urlparse("x-newscheme://foo.com/stuff"),
738 self.assertEqual(urllib.parse.urlparse("x-newscheme://foo.com/stuff?query#fragment"),
740 self.assertEqual(urllib.parse.urlparse("x-newscheme://foo.com/stuff?query"),
744 self.assertEqual(urllib.parse.urlparse(b"s3://foo.com/stuff"),
746 self.assertEqual(urllib.parse.urlparse(b"x-newscheme://foo.com/stuff"),
748 self.assertEqual(urllib.parse.urlparse(b"x-newscheme://foo.com/stuff?query#fragment"),
750 self.assertEqual(urllib.parse.urlparse(b"x-newscheme://foo.com/stuff?query"),
755 for func in (urllib.parse.urlparse, urllib.parse.urlsplit):
783 for func in (urllib.parse.urlparse, urllib.parse.urlsplit):
784 if attr == "params" and func is urllib.parse.urlsplit:
805 urllib.parse.urlparse("www.python.org", b"http")
807 urllib.parse.urlparse(b"www.python.org", "http")
809 urllib.parse.urlsplit("www.python.org", b"http")
811 urllib.parse.urlsplit(b"www.python.org", "http")
813 urllib.parse.urlunparse(( b"http", "www.python.org","","","",""))
815 urllib.parse.urlunparse(("http", b"www.python.org","","","",""))
817 urllib.parse.urlunsplit((b"http", "www.python.org","","",""))
819 urllib.parse.urlunsplit(("http", b"www.python.org","","",""))
821 urllib.parse.urljoin("http://python.org", b"http://python.org")
823 urllib.parse.urljoin(b"http://python.org", "http://python.org")
853 urllib.parse.DefragResult,
854 urllib.parse.SplitResult,
855 urllib.parse.ParseResult,
861 result = urllib.parse.parse_qs("key=\u0141%E9", encoding="latin-1")
863 result = urllib.parse.parse_qs("key=\u0141%C3%A9", encoding="utf-8")
865 result = urllib.parse.parse_qs("key=\u0141%C3%A9", encoding="ascii")
867 result = urllib.parse.parse_qs("key=\u0141%E9-", encoding="ascii")
869 result = urllib.parse.parse_qs("key=\u0141%E9-", encoding="ascii",
874 result = urllib.parse.parse_qsl("key=\u0141%E9", encoding="latin-1")
876 result = urllib.parse.parse_qsl("key=\u0141%C3%A9", encoding="utf-8")
878 result = urllib.parse.parse_qsl("key=\u0141%C3%A9", encoding="ascii")
880 result = urllib.parse.parse_qsl("key=\u0141%E9-", encoding="ascii")
882 result = urllib.parse.parse_qsl("key=\u0141%E9-", encoding="ascii",
888 urllib.parse.parse_qs('&'.join(['a=a']*11), max_num_fields=10)
890 urllib.parse.parse_qs(';'.join(['a=a']*11), max_num_fields=10)
891 urllib.parse.parse_qs('&'.join(['a=a']*10), max_num_fields=10)
896 result = urllib.parse.urlencode({'a': [1, 2], 'b': (3, 4, 5)}, True)
904 result = urllib.parse.urlencode({'a': Trivial()}, True)
908 result = urllib.parse.urlencode({'a': 'some value'})
910 result = urllib.parse.urlencode({'a': 'some value/another'},
911 quote_via=urllib.parse.quote)
913 result = urllib.parse.urlencode({'a': 'some value/another'},
914 safe='/', quote_via=urllib.parse.quote)
918 self.assertRaises(TypeError, urllib.parse.quote_from_bytes, 'foo')
919 result = urllib.parse.quote_from_bytes(b'archaeological arcana')
921 result = urllib.parse.quote_from_bytes(b'')
925 result = urllib.parse.unquote_to_bytes('abc%20def')
927 result = urllib.parse.unquote_to_bytes('')
931 self.assertRaises(TypeError, urllib.parse.quote, b'foo',
933 self.assertRaises(TypeError, urllib.parse.quote, b'foo', errors='strict')
936 p1 = urllib.parse.urlsplit('tel:+31-641044153')
939 p2 = urllib.parse.urlsplit('tel:+31641044153')
943 p1 = urllib.parse.urlparse('tel:+31-641044153')
946 p2 = urllib.parse.urlparse('tel:+31641044153')
952 p1 = urllib.parse.urlparse('http://Server=sde; Service=sde:oracle')
956 p2 = urllib.parse.urlsplit('http://Server=sde; Service=sde:oracle')
961 p1 = urllib.parse.urlparse('tel:123-4;phone-context=+1-650-516')
966 p1 = urllib.parse.urlparse('tel:+1-201-555-0123')
971 p1 = urllib.parse.urlparse('tel:7042;phone-context=example.com')
976 p1 = urllib.parse.urlparse('tel:863-1234;phone-context=+1-914-555')
982 quoter = urllib.parse.Quoter(urllib.parse._ALWAYS_SAFE)
993 for name in dir(urllib.parse):
996 object = getattr(urllib.parse, name)
999 self.assertCountEqual(urllib.parse.__all__, expected)
1018 urllib.parse.urlsplit('http://\u30d5\u309a:80')
1020 urllib.parse.urlsplit('http://\u30d5\u309a\ufe1380')
1028 urllib.parse.urlsplit(url)
1035 splittype = urllib.parse._splittype
1043 splithost = urllib.parse._splithost
1072 splituser = urllib.parse._splituser
1087 splitpasswd = urllib.parse._splitpasswd
1103 splitport = urllib.parse._splitport
1114 splitnport = urllib.parse._splitnport
1128 splitquery = urllib.parse._splitquery
1138 splittag = urllib.parse._splittag
1150 splitattr = urllib.parse._splitattr
1161 splitvalue = urllib.parse._splitvalue
1169 result = urllib.parse._to_bytes('http://www.python.org')
1171 self.assertRaises(UnicodeError, urllib.parse._to_bytes,
1177 url = urllib.parse.unwrap(wrapped_url)
1185 urllib.parse.splittype('')
1192 urllib.parse.splithost('')
1199 urllib.parse.splituser('')
1206 urllib.parse.splitpasswd('')
1213 urllib.parse.splitport('')
1220 urllib.parse.splitnport('')
1227 urllib.parse.splitquery('')
1234 urllib.parse.splittag('')
1241 urllib.parse.splitattr('')
1248 urllib.parse.splitvalue('')
1255 urllib.parse.to_bytes('')