
    daf65                       d dl Z d dlZd dlZd dlZdZdZdZdZg dg fdg fdg fdd	gfd
dgfddgfddgfddgfddgfdddgfddgfddgfdddgfdddgfdg fd g fd!g fd"d#gfd$d%gfd&d'gfd(d'gfd)d*gfd+d,gfd-d.d/gfd0d1gfd2d.gfd3d4d5gfd6d7d8gfd9d:gfd;d<gfd=d>gfd?d@gfdAdBgfdCdBgfdDdEgfdFdGgfdHdGgfdIdJgfdKdJgfZ	g di fdi fdi fdddgifd
ddgifdddgifdddgifdddLgifddMdNgifddOgdPgdQfdddRgifdddOgifddSgdTgdfdddUdVgifdi fd i fd!i fd"ddgifd$dd&gifd&d&dgifd(d&dgifd)d&dWgifd+dXdYgifd-dZgd[gd\fd0d&d]gifd2d&dZgifd3d^gd_gd.fd6d&d`dagifd9dbdOgifd;ddcgifd=dddZgifd?d&degifdfd&dggifdAdhdigifdCdhdigifdDdjdjgifdFdkdlgifdHdkdlgifdIdmdngifdKdmdngifZ
 G do dpej                        Z G dq drej                        Z G ds dtej                        Zeduk(  r ej                           yy)v    Nhttp://a/b/c/d;p?q#fhttp://a/b/c/d;p?qhttp://a/b/c/d &z&&=)r   r   z=a)r   ar	   )r	   r   za=za=b=c)r	   b=cza%3Db=c)a=bcza=b&c=dr	   b)r   dz	a=b%26c=d)r	   b&c=dz&a=bza=a+b&b=b+cr	   a br   b cza=1&a=2r	   1r	   2       &s   &&   =)r   r   s   =a)r      ar   )r   r   s   a=s   a=b=c)r      b=cs   a%3Db=c)   a=b   cs   a=b&c=dr      b)r      ds	   a=b%26c=d)r      b&c=ds   &a=bs   a=a+b&b=b+cr      a br!      b cs   a=1&a=2r      1r      2;a=b);ar   a=a+b;b=b+c)r	   	a b;b=b c   ;a=b)   ;ar!      a=a+b;b=b+c)r   	   a b;b=b cu   Ł=é)   Ł   éz%C5%81=%C3%A9z%81=%A9)   �r6   s   Ł=é)   Ł   és   %C5%81=%C3%A9s   =)      s   %81=%A9r
   r   r   r   r   )r	   r   r   r   r   r   r   r   r   r   r!   r"   )r   r   r#   r%   r'   r)   r+   r-   r/   r1   r3   s   a=a%E2%80%99bs   a’br4   r5   r6   r7   r8   r9   r:   c                   X   e Zd Zd9dZd Zd Zd Zd Zd Zd Z	d	 Z
d
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d  Z!d! Z"d" Z#d# Z$d$ Z%d% Z&d& Z'd' Z(d( Z)d) Z*d* Z+d+ Z,d, Z-d- Z.d. Z/d/ Z0d0 Z1d1 Z2d2 Z3d3 Z4d4 Z5d5 Z6d6 Z7d7 Z8d8 Z9y):UrlParseTestCaseNc                 
   ||}t         j                  j                  |      }| j                  ||       |j                  |j
                  |j                  |j                  |j                  |j                  f}| j                  ||       t         j                  j                  |      }| j                  ||       | j                  ||j                                t         j                  j                  |j                               }| j                  |j                         |j                                | j                  ||       | j                  |j                  |j                         | j                  |j
                  |j
                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                   |j                          t         j                  j#                  |      }| j                  ||       |j                  |j
                  |j                  |j                  |j                  f}| j                  ||       t         j                  j%                  |      }| j                  ||       | j                  ||j                                t         j                  j#                  |j                               }| j                  |j                         |j                                | j                  ||       | j                  |j                  |j                         | j                  |j
                  |j
                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                   |j                          y N)urllibparseurlparseassertSequenceEqualschemenetlocpathparamsqueryfragment
urlunparsegeturlassertEqualusernamepasswordhostnameporturlsplit
urlunsplit)	selfurlparsedspliturl2resulttresult2result3s	            -/root/Python-3.12.4/Lib/test/test_urlparse.pycheckRoundtripsz UrlParseTestCase.checkRoundtripsj   s   <D&&s+  0]]FMM6;;]]FLL&//;  F+,,))&1  $/  &--/: ,,''8)6==?;  &16==96==96;;76==96<<8))6??;))6??;))6??;))6??;6;;7 &&s+  /]]FMM6;;\\6??,  E*,,))&1  $/  &--/: ,,''8)6==?;  &16==96==96;;76<<8))6??;))6??;))6??;))6??;6;;7r   c                 B   t         D ]  \  }}t        j                  j                  |d      }| j	                  ||d|z         |D cg c]  }t        |d         s| }}t        j                  j                  |d      }| j	                  ||d|z          y c c}w )NTkeep_blank_valuesError parsing %r   F)parse_qsl_test_casesr?   r@   	parse_qslrK   lenrR   origexpectrW   vexpect_without_blankss         r[   test_qslzUrlParseTestCase.test_qsl   s    0 	7LD&\\++DD+IFVV-?$-FG06$D1#ad)Q$D!$D\\++DE+JFV%:.57	7 %Es   BBc                 N   t         D ]  \  }}t        j                  j                  |d      }| j	                  ||d|z         |D ci c]  }t        ||   d         r|||    }}t        j                  j                  |d      }| j	                  ||d|z          y c c}w )NTr^   r`   r   F)parse_qs_test_casesr?   r@   parse_qsrK   rd   re   s         r[   test_qszUrlParseTestCase.test_qs   s    / 	7LD&\\**44*HFVV-?$-FG.4%K)*F1IaL8I &'q	\ %K! %K\\**45*IFV%:.57	7%Ks   B"c                     g d}d }|D cg c]
  } ||       }}|dgz  }||z   D ]  \  }}}| j                  |||        y c c}w )N))path/to/file)r   r   rp   r   r   r   )r   r   rp   r   r   )/path/to/filer   r   rq   r   r   r   r   r   rq   r   r   )//path/to/file)r   rE   /to/filer   r   r   )r   rE   ru   r   r   )z////path/to/file)r   r   rt   r   r   r   )r   r   rt   r   r   )z/////path/to/file)r   r   ///path/to/filer   r   r   )r   r   rv   r   r   )zscheme:path/to/file)rC   r   rp   r   r   r   )rC   r   rp   r   r   )scheme:/path/to/filerC   r   rq   r   r   r   rC   r   rq   r   r   )zscheme://path/to/file)rC   rE   ru   r   r   r   )rC   rE   ru   r   r   )zscheme:////path/to/file)rC   r   rt   r   r   r   )rC   r   rt   r   r   )zscheme://///path/to/file)rC   r   rv   r   r   r   )rC   r   rv   r   r   )file:///tmp/junk.txtfiler   /tmp/junk.txtr   r   r   r|   r   r}   r   r   )zfile:////tmp/junk.txt)r|   r   //tmp/junk.txtr   r   r   )r|   r   r   r   r   )zfile://///tmp/junk.txt)r|   r   ///tmp/junk.txtr   r   r   )r|   r   r   r   r   )zimap://mail.python.org/mbox1)imapmail.python.org/mbox1r   r   r   )r   r   r   r   r   )z1mms://wms.sys.hinet.net/cts/Drama/09006251100.asf)mmswms.sys.hinet.net/cts/Drama/09006251100.asfr   r   r   )r   r   r   r   r   )znfs://server/path/to/file.txt)nfsserver/path/to/file.txtr   r   r   )r   r   r   r   r   )z0svn+ssh://svn.zope.org/repos/main/ZConfig/trunk/)svn+sshsvn.zope.org/repos/main/ZConfig/trunk/r   r   r   )r   r   r   r   r   )z)git+ssh://git@github.com/user/project.git)git+sshgit@github.com/user/project.gitr   r   r   )r   r   r   r   r   )zEitms-services://?action=download-manifest&url=https://example.com/app)itms-servicesr   r   r   4action=download-manifest&url=https://example.com/appr   )r   r   r   r   r   )+scheme:path/to/file)r   r   r   r   r   r   )r   r   r   r   r   )sch_me:path/to/file)r   r   r   r   r   r   )r   r   r   r   r   c                 |    | d   j                  d      t        d | d   D              t        d | d   D              fS )Nr   asciic              3   >   K   | ]  }|j                  d         ywr   Nencode.0xs     r[   	<genexpr>zDUrlParseTestCase.test_roundtrips.<locals>._encode.<locals>.<genexpr>        :!((7+:   ra   c              3   >   K   | ]  }|j                  d         ywr   r   r   s     r[   r   zDUrlParseTestCase.test_roundtrips.<locals>._encode.<locals>.<genexpr>   r   r      r   tuplerX   s    r[   _encodez1UrlParseTestCase.test_roundtrips.<locals>._encode   @    aDKK(:QqT:::QqT::< <r   )   schème:path/to/file)r   r   r   r   r   r   )r   r   r   r   r   r\   )rR   	str_casesr   r   bytes_casesrS   rT   rU   s           r[   test_roundtripsz UrlParseTestCase.test_roundtrips   sq    H	R	< ,55awqz557 		
 #,k"9 	5C  fe4	5 6s   Ac                     g d}d }|D cg c]
  } ||       }}||z   D ]  \  }}}}| j                  ||||        y c c}w )N))rv   rq   rr   rs   )zscheme:///path/to/filerw   rx   ry   )zfile:/tmp/junk.txtrz   r{   r~   )zhttp:/tmp/junk.txtzhttp:///tmp/junk.txt)httpr   r}   r   r   r   )r   r   r}   r   r   )zhttps:/tmp/junk.txtzhttps:///tmp/junk.txt)httpsr   r}   r   r   r   )r   r   r}   r   r   c                     | d   j                  d      | d   j                  d      t        d | d   D              t        d | d   D              fS )Nr   r   ra   c              3   >   K   | ]  }|j                  d         ywr   r   r   s     r[   r   zRUrlParseTestCase.test_roundtrips_normalization.<locals>._encode.<locals>.<genexpr>#  r   r   r   c              3   >   K   | ]  }|j                  d         ywr   r   r   s     r[   r   zRUrlParseTestCase.test_roundtrips_normalization.<locals>._encode.<locals>.<genexpr>$  r   r      r   r   s    r[   r   z?UrlParseTestCase.test_roundtrips_normalization.<locals>._encode   sP    aDKK(aDKK(:QqT:::QqT::< <r   r   )	rR   r   r   r   r   rS   rV   rT   rU   s	            r[   test_roundtrips_normalizationz.UrlParseTestCase.test_roundtrips_normalization	  s]    
	,	<
 ,55awqz55(1K(? 	;$Cvu  feT:	; 6s   Ac                     g d}d }|D cg c]
  } ||       }}d}d}||f}||f}||fD ];  \  }	}
|	D ]1  }|
D ]*  \  }}}||z   }|f|z   }|f|z   }| j                  |||       , 3 = y c c}w )N))z://www.python.org)www.python.orgr   r   r   r   )r   r   r   r   )z://www.python.org#abc)r   r   r   r   abc)r   r   r   r   )z://www.python.org?q=abc)r   r   r   q=abcr   )r   r   r   r   )z://www.python.org/#abc)r   /r   r   r   )r   r   r   r   )z://a/b/c/d;p?q#f)r	   z/b/c/dpqf)r	   z/b/c/d;pr   r   c                 |    | d   j                  d      t        d | d   D              t        d | d   D              fS )Nr   r   c              3   >   K   | ]  }|j                  d         ywr   r   r   s     r[   r   zIUrlParseTestCase.test_http_roundtrips.<locals>._encode.<locals>.<genexpr>@  r   r   ra   c              3   >   K   | ]  }|j                  d         ywr   r   r   s     r[   r   zIUrlParseTestCase.test_http_roundtrips.<locals>._encode.<locals>.<genexpr>A  r   r   r   r   r   s    r[   r   z6UrlParseTestCase.test_http_roundtrips.<locals>._encode>  r   r   )r   r   )   http   httpsr   )rR   r   r   r   r   str_schemesbytes_schemes	str_testsbytes_testsschemes
test_casesrC   rS   rT   rU   s                  r[   test_http_roundtripsz%UrlParseTestCase.test_http_roundtrips)  s    	"	< ,55awqz55'+*	#[0$-{#; 	=GZ! =*4 =&C 3,C$Y/F#I-E((fe<	==	= 6s   A,c                 "   |||f}| j                  t        j                  j                  ||      |       |D cg c]  }|j	                  d       c}x}\  }}}	| j                  t        j                  j                  ||      |	       y c c}w )Nr   )rK   r?   r@   urljoinr   )
rR   baserelurlexpectedstr_componentsr   bytes_componentsbasebrelurlb	expectedbs
             r[   	checkJoinzUrlParseTestCase.checkJoinO  s    1--dF;XF7E8G23AHHW-8G 	G45'9--eW=yI8Gs   Bc                    g d}|D cg c]  }|j                  d       }}||z   D ]  }| j                  t        j                  j	                  t        j                  j                  |            |       | j                  t        j                  j                  t        j                  j                  |            |        y c c}w )N)Pythonz./Pythonx-newscheme://foo.com/stuffzx://yzx:/yzx:/r   r   )r   rK   r?   r@   rQ   rP   rI   rA   )rR   r   r   r   us        r[   test_unparse_parsez#UrlParseTestCase.test_unparse_parseV  s    b	2;<Qqxx(<<[( 	SAV\\44V\\5J5J15MNPQRV\\44V\\5J5J15MNPQR	S =s   Cc                    | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        d	d
       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        d d       | j                  t        d!d"       | j                  t        d#d$       | j                  t        d%d$       | j                  t        d&d       | j                  t        d'd(       | j                  t        d)d*       | j                  t        d+d,       | j                  t        d-d.       | j                  t        d/d0       | j                  t        d1d"       | j                  t        d2d       | j                  t        d3d4       | j                  t        d5d6       y )7Ng:hghttp://a/b/c/g./gg/http://a/b/c/g//g
http://a/g//ghttp://gg?yhttp://a/b/c/g?yg?y/./xhttp://a/b/c/g?y/./x#shttp://a/b/c/d;p?q#sg#shttp://a/b/c/g#sg#s/./xhttp://a/b/c/g#s/./xg?y#shttp://a/b/c/g?y#sg;xhttp://a/b/c/g;xg;x?y#shttp://a/b/c/g;x?y#s.http://a/b/c/./..http://a/b/../../ghttp://a/b/g../..	http://a/../../../../gr   r   g.http://a/b/c/g..ghttp://a/b/c/.gg..http://a/b/c/g....ghttp://a/b/c/..g./../g./g/.g/./hhttp://a/b/c/g/hg/../hhttp://a/b/c/h)r   RFC1808_BASErR   s    r[   test_RFC1808zUrlParseTestCase.test_RFC1808]  s   |UE2|S*:;|U,<=|T+<=|T<8|UJ7|U,>?|Y0FG|T+AB|U,>?|Y0FG|W.BC|U,>?|Y0FG|S/:|T?;|T=9|UM:|V^<|Wk:|X{;|Y= 	|R)?@|T+<=|T+<=|U,>?|U,>?|X~>|W.?@|W.@A|X/?@r   c                 b    | j                  t        j                  j                  d      d       y )Nzmailto:1337@example.org)mailtor   z1337@example.orgr   r   r   rK   r?   r@   rA   r  s    r[   test_RFC2368zUrlParseTestCase.test_RFC2368  s&    ../HI>	@r   c                 V   | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        d	d
       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd        | j                  t        d!d        | j                  t        d"d       | j                  t        d#t               | j                  t        d$d%       | j                  t        d&d'       | j                  t        d(d)       | j                  t        d*d+       | j                  t        d,d       | j                  t        d-d       | j                  t        d.d/       | j                  t        d0d1       | j                  t        d2d3       | j                  t        d4d5       | j                  t        d6d7       | j                  t        d8d9       | j                  t        d:d;       | j                  t        d<d=       y )>Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r	  r
  r  r  	g;x=1/./yhttp://a/b/c/g;x=1/y
g;x=1/../yhttp://a/b/c/yr   r   g?y/../xhttp://a/b/c/g?y/../xr   r   g#s/../xhttp://a/b/c/g#s/../x)r   RFC2396_BASEr  s    r[   test_RFC2396zUrlParseTestCase.test_RFC2396  sJ    	|UE2|S*:;|U,<=|T+<=|T<8|UJ7|U,>?|T+AB|U,>?|W.BC|U,>?|Y0FG|S/:|T?;|T=9|UM:|V^<|Wk:|X{;|Y=|R6|T+<=|T+<=|U,>?|U,>?|X~>|W.?@|W.@A|X/?@|[2HI|\3CD|Y0FG|Z1HI|Y0FG|Z1HIr   c                 @   | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        d	d
       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        d d!       | j                  t        d"d!       | j                  t        d#d$       | j                  t        d%d&       | j                  t        d'd&       | j                  t        d(d       | j                  t        d)d       | j                  t        d)d       | j                  t        d*d       | j                  t        d+d       | j                  t        d,d       | j                  t        d-d.       | j                  t        d/d0       | j                  t        d1d2       | j                  t        d3d4       | j                  t        d5d$       | j                  t        d6d
       | j                  t        d7d8       | j                  t        d9d:       | j                  t        d;d<       | j                  t        d=d>       | j                  t        d?d@       | j                  t        dAdB       | j                  t        dCdD       | j                  t        dEdF       | j                  t        dGd       | j                  dHdd       y )IN?yzhttp://a/b/c/d;p?yz;xzhttp://a/b/c/;xr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   z
../../../gz../../../../gz/./gz/../gr   r   r  r  r  r  r  r  r  r  r	  r
  r  r  r  r  r  r  r   r   r  r  r   r   r  r  http:gzhttp://a/b/c/de)r   RFC3986_BASEr  s    r[   test_RFC3986zUrlParseTestCase.test_RFC3986  s   |T*>?|T+<=|U51|S)9:|U+;<|T*;<|T,7|U:6|T*>?|U+=>|T*@A|U+=>|W-AB|T*;<|U+=>|Y/EF|R(<=|S9|T/:|T-8|U=9|VN;|W[9|Xk:|Y|<|\<@ 	|\,?|_\B|VL9|W\:|T*;<|T*;<|U+=>|U+=>|Xn=|W->?|W-?@|X.>?|[1GH|\2BC|Y/EF|Z0GH|Y/EF|Z0GH|X.>? 	($/@Ar   c                 4   | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd	       | j                  t        d
d       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        dd       | j                  t        d d	       | j                  t        d!d"       | j                  t        d#d$       | j                  t        dd       | j                  t        dd       | j                  t        d%d       | j                  t        d&d       | j                  t        d'd       | j                  d(dd(       | j                  d)dd       | j                  d)d*d*       | j                  d+d,d-       | j                  d.d,d/       | j                  d0dd1       | j                  d2dd3       | j                  t        d4z   d5t        d6z          | j                  d7d8d9       | j                  d:d8d;       | j                  d7d<d=       | j                  d:d<d=       | j                  d7d>d?       | j                  dd8d=       | j                  d@dAdA       y )BNr   r!  r   http:r   r   r   r   r   r   r   r   r   r   zhttp://a/b/c/d?yr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r	  r
  r  r  zhttp:?yzhttp:g?yzhttp:g?y/./xzhttp:///r   zhttp://a/./gzsvn://pathtorepo/dir1dir2zsvn://pathtorepo/dir2zsvn+ssh://pathtorepo/dir1zsvn+ssh://pathtorepo/dir2zws://a/bzws://a/gz	wss://a/bz	wss://a/gr   fooz/foozhttp://a/b/c/d/e/z
../../f/g/zhttp://a/b/c/f/g/zhttp://a/b/c/d/ezhttp://a/b/f/g/z/../../f/g/zhttp://a/f/g/z	../../f/gzhttp://a/b/c/f/gr	   r   )r   SIMPLE_BASEr  s    r[   test_urljoinszUrlParseTestCase.test_urljoins  s   {E%0{H-=>{G,<={C(89{E*:;{D):;{D6{E*5{D);<{E*<={I.DE{C8{D9{D7{E-8{F>:{GK8{Il;{H^<{G,=>{G,>?{H-=>{H-=>{G,<={I.@A{J/AB{N3IJz4
3r12HIr>>:.8OP2F<WXz#j1{3{3 	{S(%v1EF 	*L:MN)<9JK*M?K)=/J*K9KL}lOD 	sC%r   c                    g d}d }|D cg c]
  } ||       }}||z   D ]O  \  }}}t         j                  j                  |      }| j                  |j                  |j
                  f||f       Q g d}|D cg c]  }|j                  d       }}||z   D ]1  }	| j                  t        t         j                  j                  |	       3 y c c}w c c}w )N))z http://Test.python.org:5432/foo/test.python.org8  )zhttp://12.34.56.78:5432/foo/12.34.56.78r,  )zhttp://[::1]:5432/foo/::1r,  )zhttp://[dead:beef::1]:5432/foo/dead:beef::1r,  )zhttp://[dead:beef::]:5432/foo/dead:beef::r,  )z:http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]:5432/foo/'dead:beef:cafe:5417:affe:8fa3:deaf:feedr,  )z http://[::12.34.56.78]:5432/foo/::12.34.56.78r,  )z%http://[::ffff:12.34.56.78]:5432/foo/::ffff:12.34.56.78r,  )zhttp://Test.python.org/foo/r+  N)zhttp://12.34.56.78/foo/r-  N)zhttp://[::1]/foo/r.  N)zhttp://[dead:beef::1]/foo/r/  N)zhttp://[dead:beef::]/foo/r0  N)z5http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/r1  N)zhttp://[::12.34.56.78]/foo/r2  N)z http://[::ffff:12.34.56.78]/foo/r3  N)zhttp://Test.python.org:/foo/r+  N)zhttp://12.34.56.78:/foo/r-  N)zhttp://[::1]:/foo/r.  N)zhttp://[dead:beef::1]:/foo/r/  N)zhttp://[dead:beef::]:/foo/r0  N)z6http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]:/foo/r1  N)zhttp://[::12.34.56.78]:/foo/r2  N)z!http://[::ffff:12.34.56.78]:/foo/r3  Nc                 Z    | d   j                  d      | d   j                  d      | d   fS )Nr   r   ra   r   r   r   s    r[   r   z.UrlParseTestCase.test_RFC2732.<locals>._encodeP  s-    Q4;;w'1W)=qtCCr   )zhttp://::12.34.56.78]/zhttp://[::1/foo/zftp://[::1/foo/bad]/badzhttp://[::1/foo/bad]/badzhttp://[::ffff:12.34.56.78r   )	r?   r@   rA   rK   rN   rO   r   assertRaises
ValueError)
rR   r   r   r   r   rS   rN   rO   	urlparsedinvalid_urls
             r[   test_RFC2732zUrlParseTestCase.test_RFC2732/  s    	@	D+45awqz55#,{#: 	VC4--c2Ii00)..AXtDTU	V.	 3<<Qqxx(<<${2 	NKj&,,*?*?M	N 6 =s   C<Cc                    ddddddddt         d	d
ft        d	dfg
}d }|D cg c]
  } ||       }}||z   D ]  \  }}}t        j                  j	                  |      }| j                  |j                         |       | j                  |||f       | j                  |j                  |       | j                  |j                  |        y c c}w )N)zhttp://python.org#fraghttp://python.orgfrag)r;  r;  r   )zhttp://python.org/#fraghttp://python.org/r<  )r=  r=  r   )zhttp://python.org/?q#fraghttp://python.org/?qr<  )r>  r>  r   )zhttp://python.org/p#fragzhttp://python.org/pr<  )http://python.org/p?qr?  r   r   r   r   c                 2     t        |       d | D              S )Nc              3   >   K   | ]  }|j                  d         ywr   r   r   s     r[   r   zCUrlParseTestCase.test_urldefrag.<locals>._encode.<locals>.<genexpr>o  s     8188G,8r   )typer   s    r[   r   z0UrlParseTestCase.test_urldefrag.<locals>._encoden  s    478a888r   )	r  r  r?   r@   	urldefragrK   rJ   rS   rH   )	rR   r   r   r   r   rS   defragr<  rW   s	            r[   test_urldefragzUrlParseTestCase.test_urldefraga  s    C:E<I@GB/5/4
		9+45awqz55!*[!8 	4C\\++C0FV]]_c2Vfd^4VZZ0V__d3	4 6s   Cc                 `   t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       y )Nz,http://[FE80::822a:a8ff:fe49:470c%tESt]:1234zfe80::822a:a8ff:fe49:470c%tEStz%[FE80::822a:a8ff:fe49:470c%tESt]:1234s,   http://[FE80::822a:a8ff:fe49:470c%tESt]:1234s   fe80::822a:a8ff:fe49:470c%tESts%   [FE80::822a:a8ff:fe49:470c%tESt]:1234)r?   r@   rP   rK   rN   rD   )rR   r   s     r[   test_urlsplit_scoped_IPv6z*UrlParseTestCase.test_urlsplit_scoped_IPv6x  s    LL!!"PQ%EF#JKLL!!"QR%FG#KLr   c                    d}t         j                  j                  |      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d        | j                  |j                  d        | j                  |j                  d       | j                  |j                  d        | j                  |j                         dd  |dd         d	}t         j                  j                  |      }| j                  |j                  d       | j                  |j
                  d
       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                         |       d}t         j                  j                  |      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                         |       d}t         j                  j                  |      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d        | j                  |j                  d        | j                  |j                  d       | j                  |j                  d        | j                  |j                         dd  |dd         d}t         j                  j                  |      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                         |       d}t         j                  j                  |      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d        | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                         |       d!}t         j                  j                  |      }| j                  t        d"      5  |j                   d d d        y # 1 sw Y   y xY w)#NzHTTP://WWW.PYTHON.ORG/doc/#fragr   zWWW.PYTHON.ORG/doc/r   r<  r      7http://User:Pass@www.python.org:080/doc/?query=yes#fragUser:Pass@www.python.org:080	query=yesUserPassP   zChttp://User@example.com:Pass@www.python.org:080/doc/?query=yes#frag(User@example.com:Pass@www.python.org:080zUser@example.coms   HTTP://WWW.PYTHON.ORG/doc/#fragr   s   WWW.PYTHON.ORG   /doc/r      frag   www.python.orgs7   http://User:Pass@www.python.org:080/doc/?query=yes#frag   User:Pass@www.python.org:080	   query=yes   User   PasssC   http://User@example.com:Pass@www.python.org:080/doc/?query=yes#frags(   User@example.com:Pass@www.python.org:080s   User@example.coms%   HTTP://WWW.PYTHON.ORG:65536/doc/#fragzout of range)r?   r@   rP   rK   rC   rD   rE   rG   rH   rL   rM   rN   rO   rJ   assertRaisesRegexr6  )rR   rS   r   s      r[   test_urlsplit_attributesz)UrlParseTestCase.test_urlsplit_attributes  s   /LL!!#&6*#34)"%V,T*T*%56& 	ABQR1GLL!!#&6*#AB)+.V,V,V,%56$S) TLL!!#&6*#MN)+.V,%78V,%56$S) 1LL!!#&7+#45*#&W-T*T*%67&ABQR1HLL!!#&7+#BC*,/W-W-W-%67$S)TLL!!#&7+#NO*,/W-%89W-%67$S) 7LL!!#&##J? 	FF	 	 	s   2__c                    d}t         j                  j                  |      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d        | j                  |j                  d        | j                  |j                  d       | j                  |j                  d        | j                  |j                         d       d}t         j                  j                  |      }| j                  |j                  d	       | j                  |j
                  d
       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d        | j                  |j                  d        | j                  |j                  d
       | j                  |j                  d        | j                  |j                         d       d}d}t        d      D ]_  }t         j                  j                  ||      }| j                  |j                  d       | j                  |j                         d       a y )NzQhttp	://www.python
.org	/java
script:	alert('msg
')/?query
=	something#frag
mentr   r   z/javascript:alert('msg')/zquery=somethingrH   zGhttp://www.python.org/javascript:alert('msg')/?query=something#fragmentsQ   http	://www.python
.org	/java
script:	alert('msg
')/?query
=	something#frag
mentr   rT  s   /javascript:alert('msg')/s   query=something   fragmentsG   http://www.python.org/javascript:alert('msg')/?query=something#fragmentzNhttp://www.python.org/java
script:	alert('msg
')/?query
=	something#frag
mentzht
tpr   rC   )r?   r@   rP   rK   rC   rD   rE   rG   rH   rL   rM   rN   rO   rJ   range)rR   rS   r   rC   _s        r[   !test_urlsplit_remove_unsafe_bytesz2UrlParseTestCase.test_urlsplit_remove_unsafe_bytes  s;   kLL!!#&6*#34!<="34Z0T*T*%56&%no mLL!!#&7+#45!=>"45[1T*T*%67&%op fq 	tA%%c&%9AQXXv.QXXZ)rs	tr   c                 	   t        t        dd            }d}|j                  d      |z   }t        j                  j                  |      }| j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d	       | j                  |j                  d
       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j!                         |       ||j#                  d      z   }t        j                  j                  |      }| j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j!                         |j#                  d             d}t        j                  j                  |j                  d      |z         }| j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j!                         |       t        j                  j                  d      }| j                  t        j                  j%                  |      d       d}|j                  d      dz   |j                  d      z   }t        d      D ]_  }t        j                  j                  ||      }| j                  |j                  d       | j                  |j!                         d       a y ) Nr   !   rK  utf-8r   rL  rI  rM  r<  rN  rO  r   rP  r   rU  rR  rV  rS  rW  rX  rT  z)https://www.python.org:88/doc/?query=    r   zwww.python.org:88z
query=    X   zwww.pypi.org z//www.python.org/r   r]  zhttps://www.python.org/)bytesr^  decoder?   r@   rP   rK   rC   rD   rE   rG   rH   rL   rM   rN   rO   rJ   r   rQ   )rR   noisebase_urlrS   r   query_spaces_urlrC   r_  s           r[   test_urlsplit_strip_urlz(UrlParseTestCase.test_urlsplit_strip_url  se   eAx()Lll7#h.LL!!#&6*#AB)+.V,V,V,%56$X.hoog..LL!!#&7+#BC*,/W-W-W-%67$X__W%=> GLL!!%,,w"7:J"JK7+#67),/$%56LL!!/2 	003_E "g&05<<3HHq 	DA%%c&%9AQXXw/QXXZ)BC	Dr   c           
      T   dD ]
  }t         j                  j                  t         j                  j                  fD ]  }dD ]  }| j	                  |||      5  d|z   }d|z   dz   }|rM|j                         r3|j                         r#|j                  d      }|j                  d      }n
	 ddd       t ||      }| j                  |j                  |       | j                  t              5  |j                   ddd       ddd          y# 1 sw Y   xY w# 1 sw Y   xY w)	z Check handling of invalid ports.FT)	r'  z1.5z-10x10z-01_1z 1z1 u   ६)re  r@   rO   zwww.example.net:zhttp://r   r   N)r?   r@   rP   rA   subTestisasciir   rK   rD   r5  r6  rO   )rR   re  r@   rO   rD   rS   r   s          r[   test_attributes_bad_portz)UrlParseTestCase.test_attributes_bad_port>  s   " 	#E ,,//1F1FG #X #DETJ #!3d!:'&036 %~~/DLLN)/w)?&)jj&9 (# # "#J((6:!..z: #FF## ###	## ## #s+   AD	49D	-D:D	DD	D'c           	         dD ]  }t         j                  j                  t         j                  j                  fD ]  }dD ]  }| j	                  |||      5  |dz   }|r,|j                         r|j                  d      }n
	 ddd       K ||      }|r| j                  |j                  d       n| j                  |j                  d       ddd          y# 1 sw Y   xY w)	z"Check handling of invalid schemes.rl  )r   +-0zhttp&u   ६http)re  r@   rC   z://www.example.netr   Nr   r   )	r?   r@   rP   rA   ro  rp  r   rK   rC   )rR   re  r@   rC   rS   r   s         r[   test_attributes_bad_schemez+UrlParseTestCase.test_attributes_bad_schemeQ  s    " 	;E ,,//1F1FG ;F ;FEvN ;$';; "{{}&)jj&9 (; ; "#J  ,,QXXs; ,,QXXr:; ;;;	;; ;s   +C	
AC	C%c                 d   d}t         j                  j                  |      }| j                  |j                  d       | j                  |j
                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         |       t         j                  j                  |      }| j                  |j                  d       | j                  |j
                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         |       d}t         j                  j                  |      }| j                  |j                  d       | j                  |j
                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         |       t         j                  j                  |      }| j                  |j                  d       | j                  |j
                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         |       y )Nz0sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15r   s0   sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15r   )r?   r@   rP   rK   rD   rL   rM   rN   rO   rJ   rA   )rR   urir   s      r[   test_attributes_without_netlocz/UrlParseTestCase.test_attributes_without_netlocc  sJ    ALL!!#&2&T*T*T*&S)LL!!#&2&T*T*T*&S) BLL!!#&3'T*T*T*&S)LL!!#&3'T*T*T*&S)r   c                     | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       y )Nz http://example.com?blahblah=/foo)r   zexample.comr   r   zblahblah=/foor   s    http://example.com?blahblah=/foo)r   s   example.comr   r   s   blahblah=/foor   r  r  s    r[   test_noslashzUrlParseTestCase.test_noslash  sJ    ../QRM	O../RSS	Ur   c                 8   | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d	      d
       | j                  t        j                  j                  d      d       y )NrE   )r   r   rE   r   r   r   z//www.python.org:80)r   www.python.org:80r   r   r   r   http://www.python.org:80r   r}  r   r   r   r      path)r   r   r  r   r   r   s   //www.python.org:80)r      www.python.org:80r   r   r   r      http://www.python.org:80r   r  r   r   r   r   r  r  s    r[   test_withoutschemez#UrlParseTestCase.test_withoutscheme  s    
 	..v6'	)../DE4	6../IJ8	: 	..w7-	/../EF:	<../JK>	@r   c                 l   | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d	      d
       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       y )Nzhttp:80)r   r   80r   r   r   zhttps:80)r   r   r  r   r   r   zpath:80)rE   r   r  r   r   r   r%  )r   r   r   r   r   r   zhttps:)r   r   r   r   r   r   r~  r  s   http:80)r   r      80r   r   r   s   https:80)r   r   r  r   r   r   s   path:80)r  r   r  r   r   r   s   http:)r   r   r   r   r   r   s   https:)r   r   r   r   r   r   r  r  r  r  s    r[   test_portseparatorz#UrlParseTestCase.test_portseparator  s   ..y9;TU..z:<VW..y9;TU..w78OP..x89QR../IJ8	: 	..z:<[\..{;=]^..z:<[\..x89VW..y9:XY../JK>	@r   c                 b    | j                  t        t        j                  j                  d       y )Nr'  )r5  	TypeErrorr?   r@   	urlencoder  s    r[   test_usingsyszUrlParseTestCase.test_usingsys  s    )V\\%;%;UCr   c                    | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d	      d
       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       | j                  t        j                  j                  d      d       y )Nzs3://foo.com/stuff)s3foo.com/stuffr   r   r   r   )x-newschemer  r  r   r   r   z*x-newscheme://foo.com/stuff?query#fragment)r  r  r  r   rG   rH   z!x-newscheme://foo.com/stuff?query)r  r  r  r   rG   r   s   s3://foo.com/stuff)s   s3   foo.com   /stuffr   r   r   s   x-newscheme://foo.com/stuff)   x-newschemer  r  r   r   r   s*   x-newscheme://foo.com/stuff?query#fragment)r  r  r  r      queryr\  s!   x-newscheme://foo.com/stuff?query)r  r  r  r   r  r   r  r  s    r[   test_anyschemezUrlParseTestCase.test_anyscheme  s$   ../CD@	B../LMI	K../[\V	X../RSN	P 	../DEF	H../MNO	Q../\]\	^../STT	Vr   c                    t         j                  j                  t         j                  j                  fD ]:  }| j	                  |      5   |dd      }| j                  |j                  d        |dd      }| j                  |j                  d       | j                   |dd      j                  d       | j                   |dd	      j                  d       | j                   |d
d	      j                  d       | j                   |d      j                  d       | j                   |d
      j                  d       | j                   |d
d      j                  d       d d d        = y # 1 sw Y   IxY w)N)functionzhttp://example.net/ftpr   s   http://example.net/s   ftpr   rE   r]  r  r   r   )r?   r@   rA   rP   ro  rK   rC   )rR   funcrW   s      r[   test_default_schemez$UrlParseTestCase.test_default_scheme  sC   \\**FLL,A,AB 	@Dt, 
@3U;  74f=  8  fe!4!;!;UC  fU!;!B!BEJ  gf!=!D!DfM  f!4!4b9  g!5!5s;  gr!2!9!93?
@ 
@	@
@ 
@s   DE44E>	c           
      J   d}|D ]  \  }}}t         j                  j                  t         j                  j                  fD ]O  }|dk(  r|t         j                  j                  u rd}| j	                  ||      5   ||d      }| j                  |j                  d       | j                  t        ||      j                  d|z                | j                   ||dd      j                  d        ||d	      }| j                  |j                  |       | j                  t        ||      j                  |             | j                   ||dd	      j                  |       | j                   ||      j                  |       d d d        R  y # 1 sw Y   axY w)
N)
)z
http:#fragrE   r<  )z//example.net#fragrE   r<  )zindex.html#fragrE   r<  )z	;a=b#fragrF   r<  )z	?a=b#fragrG   r<  )z#fragrE   r<  )z	abc#@fragrE   @frag)z//abc#@fragrE   r  )z//abc:80#@fragrE   r  )z//abc#@frag:80rE   z@frag:80rF   rE   )rS   r  F)allow_fragmentsr   #T)r?   r@   rA   rP   ro  rK   rH   
assertTruegetattrendswithassertFalse)rR   testsrS   attrexpected_fragr  rW   s          r[   test_parse_fragmentsz%UrlParseTestCase.test_parse_fragments  s   
 ). 	H$C}..0E0EF H8#0E0E(E!D\\cD\9 H!#u=F$$V__b9OO#FD1::3;NOQ$$T#r5%9%B%BBG!#t<F$$V__mD$$#FD1::=IK$$T#r4%8%A%A%24$$T#Y%7%7GH HH	HH Hs   ;DFF"c                    | j                  t        d      5  t        j                  j	                  dd       d d d        | j                  t        d      5  t        j                  j	                  dd       d d d        | j                  t        d      5  t        j                  j                  dd       d d d        | j                  t        d      5  t        j                  j                  dd       d d d        | j                  t        d      5  t        j                  j                  d       d d d        | j                  t        d      5  t        j                  j                  d       d d d        | j                  t        d      5  t        j                  j                  d       d d d        | j                  t        d      5  t        j                  j                  d	       d d d        | j                  t        d      5  t        j                  j                  d
d       d d d        | j                  t        d      5  t        j                  j                  dd
       d d d        y # 1 sw Y   >xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   wxY w# 1 sw Y   FxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)NzCannot mix strr   r   rT  r   )r   r   r   r   r   r   )r   rT  r   r   r   r   )r   r   r   r   r   )r   rT  r   r   r   r;  s   http://python.org)	rY  r  r?   r@   rA   rP   rI   rQ   r   r  s    r[   test_mixed_types_rejectedz*UrlParseTestCase.test_mixed_types_rejected  sj    ##I/?@ 	=LL!!"2G<	=##I/?@ 	=LL!!"3V<	=##I/?@ 	=LL!!"2G<	=##I/?@ 	=LL!!"3V<	=##I/?@ 	NLL##$LM	N##I/?@ 	MLL##$KL	M##I/?@ 	JLL##$HI	J##I/?@ 	JLL##$HI	J##I/?@ 	LLL  !46JK	L##I/?@ 	LLL  !57JK	L 	L%	= 	=	= 	=	= 	=	= 	=	N 	N	M 	M	J 	J	J 	J	L 	L	L 	Lsw   !I4!J!J!J J( J5 K K!K
!K'4I>JJJ%(J25J?KKK$'K0c                    t        |j                        }|j                  }| j                  |j                  |       d|z  }d|z  } || } || }d}d}	| j                  ||       | j                  |j                         |       | j                  |j                         |       | j                  |j                  |      |       | j                  |j                  |      |       | j                  |j                  ||	      |       | j                  |j                  ||	      |       | j                  ||       | j                  |j                         |       | j                  |j                         |       | j                  |j                  |      |       | j                  |j                  |      |       | j                  |j                  ||	      |       | j                  |j                  ||	      |       y )N)r   )r   r   strict)rd   _fields_encoded_counterpartassertIs_decoded_counterpartrK   rf  r   )
rR   str_typenum_args
bytes_typestr_args
bytes_args
str_resultbytes_resultencodingerrorss
             r[   _check_result_typez#UrlParseTestCase._check_result_type  s   x''(22
j55x@8#h&
x(
!:.X.,,.9,,.
;,,X6A,,X6
C,,Xv>I,,Xv>
Kz2**,j9**,l;**84jA**84lC**8V<jI**8V<lKr   c                     t         j                  j                  t         j                  j                  t         j                  j                  g}|D ]  }| j                  |        y r>   )r?   r@   DefragResultSplitResultParseResultr  )rR   result_typesresult_types      r[   test_result_pairsz"UrlParseTestCase.test_result_pairs2  sQ     ,,
#
#
,,
"
"
,,
"
"

 ( 	1K##K0	1r   c                 "   t         j                  j                  dd      }| j                  |ddgi       t         j                  j                  dd      }| j                  |ddgi       t         j                  j                  dd      }| j                  |dd	gi       t         j                  j                  d
d      }| j                  |ddgi       t         j                  j                  d
dd      }| j                  |ddgi       y )N	   key=Ł%E9latin-1r  key   Łé   key=Ł%C3%A9rc  r      Ł��
   key=Ł%E9-   Ł�-ignorer  r     Ł-)r?   r@   rm   rK   rR   rW   s     r[   test_parse_qs_encodingz'UrlParseTestCase.test_parse_qs_encoding<  s   &&&K%,!89&&'9G&L%,!89&&'9G&L%*>)?!@A&&'7'&J%/):!;<&&'7'AI ' K%)!56r   c                    t         j                  j                  dd      }| j                  |dg       t         j                  j                  dd      }| j                  |dg       t         j                  j                  dd      }| j                  |dg       t         j                  j                  d	d      }| j                  |d
g       t         j                  j                  d	dd      }| j                  |dg       y )Nr  r  r  )r  r  r  rc  r   )r  r  r  )r  r  r  r  )r  r  )r?   r@   rc   rK   r  s     r[   test_parse_qsl_encodingz(UrlParseTestCase.test_parse_qsl_encodingI  s    '')'L"7!89''(:W'M"7!89''(:W'M"?!@A''(87'K":!;<''(87AI ( K"4!56r   c                 (   | j                  t              5  t        j                  j	                  dj                  dgdz        d       d d d        t        j                  j	                  dj                  dgdz        d       y # 1 sw Y   >xY w)Nr   za=a   
   )max_num_fields)r5  r6  r?   r@   rc   joinr  s    r[   test_parse_qsl_max_num_fieldsz.UrlParseTestCase.test_parse_qsl_max_num_fieldsV  su    z* 	LLL""388UGBJ#7"K	Lsxx
3BG	L 	Ls   5BBc                    di fdi fdddgifddgdgd	fd
dddgifdi fdi fdddgifddgdgdfddddgifg
}|D ]  \  }}| j                  d|d|      5  t        j                  j                  |d      }| j	                  ||d|z         t        j                  j                  |d      }| j	                  ||d|z         d d d         y # 1 sw Y   xY w)N;;;r,   r	   r   r.   r   r   r   a=1;a=2r   r      ;   ;;r0   r   r!   r2   r%   r'   r       a=1;a=2r)   r+   
Original: , Expected: 	separatorr`   )ro  r?   r@   rm   rK   )rR   parse_qs_semicolon_casesrf   rg   rW   result_bytess         r[   test_parse_qs_separatorz(UrlParseTestCase.test_parse_qs_separator[  s7   "I2JcC5\"5'89sCj)*2JBKtdVn%VHVH=>$t-.$
  5 	RLD&
4(,vjIJ R..ts.C  1Cd1JK%||44TT4J  v7ID7PQ	R R	RR Rs   A/CC	c                    dg fdg fddgfdddgfdd	d
gfdg fdg fddgfdddgfdddgfg
}|D ]  \  }}| j                  d|d|      5  t        j                  j                  |d      }| j	                  ||d|z         t        j                  j                  |d      }| j	                  ||d|z         d d d         y # 1 sw Y   xY w)Nr  r  r,   r   r.   r   r   r  r   r   r  r  r0   r    r2   r$   r&   r  r(   r*   r  r  r  r`   )ro  r?   r@   rc   rK   )rR   parse_qsl_semicolon_casesrf   rg   rW   r  s         r[   test_parse_qsl_separatorz)UrlParseTestCase.test_parse_qsl_separatorp  s   "I2Jj\"\<89Z012JBK|n%nn=>,56%
! 6 	RLD&
4(,vjIJ R///D  1Cd1JK%||55dd5K  v7ID7PQ	R R	RR Rs   
A/CC	c                 H   | j                  t        j                  j                  d      dg       | j                  t        j                  j                  t	        d            dg       | j                  t        j                  j                  t        d            dg       y )Nr   r    )rK   r?   r@   rc   	bytearray
memoryviewr  s    r[   test_parse_qsl_bytesz%UrlParseTestCase.test_parse_qsl_bytes  so    //7,H//	&0AB\NS//
60BCl^Tr   c           
         t        dd      }ddd ddg i t        d      fD ]c  }| j                  t        j                  j
                  |fi |g        | j                  t        t        j                  j
                  |d       e y )	NT)r_   strict_parsingr   r   r           ra   r  )dictr  rK   r?   r@   rc   r5  r6  )rR   kwargsr   s      r[   test_parse_qsl_false_valuez+UrlParseTestCase.test_parse_qsl_false_value  sy    TBS$3B
3? 	RAV\\33A@@"Ej&,,*@*@!qQ	Rr   c                    | j                  t        t        j                  j                  t        d             | j                  t        t        j                  j                  t        d             | j                  t        t        j                  j                  d       | j                  t        t        j                  j                  t                      dD ]A  }| j                  t              5  t        j                  j	                  d|       d d d        C | j                  t              5  t        j                  j	                  dd       d d d        | j                  t              5  t        j                  j	                  dd       d d d        y # 1 sw Y   xY w# 1 sw Y   UxY w# 1 sw Y   y xY w)Nr   ra   )r   r   Nr   ra   r  g      ?r   r     ¦   )r5  r  r?   r@   rc   listiterobjectr6  UnicodeEncodeErrorUnicodeDecodeError)rR   r  s     r[   test_parse_qsl_errorsz&UrlParseTestCase.test_parse_qsl_errors  sN   )V\\%;%;T&\J)V\\%;%;T&\J)V\\%;%;Q?)V\\%;%;VXF6 	CI"":. C&&u	&BC C	C 12 	=LL""6V"<	=12 	=LL""5G"<	= 	=	C C	= 	=	= 	=s$   1"F2"F(1"F4F%	(F14F=c                    t         j                  j                  ddgddd      }t        |j	                  d            h dk(  sJ  G d d	      }t         j                  j                  d
 |       id      }| j                  |d       y )Nra   r   )r   rJ     r   Tr   >   a=1a=2b=3b=4b=5c                       e Zd Zd Zy):UrlParseTestCase.test_urlencode_sequences.<locals>.Trivialc                      y)Ntrivial r  s    r[   __str__zBUrlParseTestCase.test_urlencode_sequences.<locals>.Trivial.__str__  s     r   N)__name__
__module____qualname__r  r  r   r[   Trivialr    s    !r   r  r	   z	a=trivial)r?   r@   r  setrU   rK   )rR   rW   r  s      r[   test_urlencode_sequencesz)UrlParseTestCase.test_urlencode_sequences  sy     ''q!f9(EtL6<<$%)LLLL	! 	! ''gi(8$?-r   c                    t         j                  j                  ddi      }| j                  |d       t         j                  j                  ddit         j                  j                        }| j                  |d       t         j                  j                  ddidt         j                  j                        }| j                  |d	       y )
Nr	   z
some valueza=some+valuezsome value/another)	quote_viaza=some%20value%2Fanotherr   )safer  za=some%20value/another)r?   r@   r  rK   quoter  s     r[   test_urlencode_quote_viaz)UrlParseTestCase.test_urlencode_quote_via  s    ''l(;<0''.B(C28,,2D2D ( F!;<''.B(C-0FLL<N<N ( P!9:r   c                    | j                  t        t        j                  j                  d       t        j                  j	                  d      }| j                  |d       t        j                  j	                  d      }| j                  |d       t        j                  j	                  ddz        }| j                  |ddz         t        j                  j	                  d	d
z        }| j                  |dd
z         y )Nr'  s   archaeological arcanazarchaeological%20arcanar   r      Ai'  As   z/ i zz%01/%20)r5  r  r?   r@   quote_from_bytesrK   r  s     r[   test_quote_from_bytesz&UrlParseTestCase.test_quote_from_bytes  s    )V\\%B%BEJ../GH!:;..s3$..tF{;V,..z'/ABG!34r   c                     t         j                  j                  d      }| j                  |d       t         j                  j                  d      }| j                  |d       y )Nz	abc%20defs   abc defr   r   )r?   r@   unquote_to_bytesrK   r  s     r[   test_unquote_to_bytesz&UrlParseTestCase.test_unquote_to_bytes  sJ    ..{;,..r2%r   c                     | j                  t        t        j                  j                  dd       | j                  t        t        j                  j                  dd       y )Ns   foorc  r  r  )r  )r5  r  r?   r@   r  r  s    r[   test_quote_errorsz"UrlParseTestCase.test_quote_errors  sI    )V\\%7%7#* 	 	,)V\\%7%7Qr   c                    t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       y )Nztel:+31-641044153telz+31-641044153ztel:+31641044153z+31641044153)r?   r@   rP   rK   rC   rE   rA   )rR   p1p2s      r[   test_issue14072z UrlParseTestCase.test_issue14072  s    \\""#67E*/2\\""#56E*.1\\""#67E*/2\\""#56E*.1r   c                    | j                  t        t        j                  j                  d       | j                  t        t        j                  j                  d       | j                  t        t        j                  j                  d       | j                  t        t        j                  j                  d       | j                  t        t        j                  j                  d       | j                  t        t        j                  j                  d       | j                  t        t        j                  j                  d       | j                  t        t        j                  j                  d       | j                  t        t        j                  j                  d	       | j                  t        t        j                  j                  d
       y )Nz&Scheme://user@[192.0.2.146]/Path?Queryz-Scheme://user@[important.com:8000]/Path?Queryz#Scheme://user@[v123r.IP]/Path?Queryz Scheme://user@[v12ae]/Path?QueryzScheme://user@[v.IP]/Path?Queryz Scheme://user@[v123.]/Path?QueryzScheme://user@[v]/Path?Queryz5Scheme://user@[0439:23af::2309::fae7:1234]/Path?QueryzJScheme://user@[0439:23af:2309::fae7:1234:2342:438e:192.0.2.146]/Path?QueryzScheme://user@]v6a.ip[/Path)r5  r6  r?   r@   rP   r  s    r[   test_invalid_bracketed_hostsz-UrlParseTestCase.test_invalid_bracketed_hosts  s*   *fll&;&;=ef*fll&;&;=lm*fll&;&;=bc*fll&;&;=_`*fll&;&;=^_*fll&;&;=_`*fll&;&;=[\*fll&;&;=tu*fll&;&;  >J  	K*fll&;&;=Z[r   c                    t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       y )	Nz!scheme://user@[v6a.ip]/path?queryzv6a.ipuser/pathz4scheme://user@[0439:23af:2309::fae7%test]/path?queryz0439:23af:2309::fae7%testzEscheme://user@[0439:23af:2309::fae7:1234:192.0.2.146%test]/path?queryz*0439:23af:2309::fae7:1234:192.0.2.146%test)r?   r@   rP   rK   rN   rL   rE   )rR   r   r!  p3s       r[   test_splitting_bracketed_hostsz/UrlParseTestCase.test_splitting_bracketed_hosts  s    \\""#FGh/f-'*\\""#YZ&ABf-'*\\""#jk&RSf-'*r   c                 `   d}t         j                  j                  d      }| j                  t        |      5  |j
                   d d d        t         j                  j                  d      }| j                  t        |      5  |j
                   d d d        y # 1 sw Y   TxY w# 1 sw Y   y xY w)Nz3Port could not be cast to integer value as 'oracle'z%http://Server=sde; Service=sde:oracle)r?   r@   rA   rY  r6  rO   rP   )rR   messager   r!  s       r[   !test_port_casting_failure_messagez2UrlParseTestCase.test_port_casting_failure_message  s    G\\""#JK##J8 	GG	 \\""#JK##J8 	GG	 			 		 	s   BB$B!$B-c                    t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d	       | j                  |j                  d
       t         j                  j                  d      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  d       y )Nz"tel:123-4;phone-context=+1-650-516r  z123-4zphone-context=+1-650-516ztel:+1-201-555-0123z+1-201-555-0123r   z"tel:7042;phone-context=example.com7042zphone-context=example.comz%tel:863-1234;phone-context=+1-914-555z863-1234zphone-context=+1-914-555)r?   r@   rA   rK   rC   rE   rF   )rR   r   s     r[   test_telurl_paramsz#UrlParseTestCase.test_telurl_params  sJ   \\""#GHE*'*$>?\\""#89E*"34B'\\""#GHE*&)$?@\\""#JKE**-$>?r   c                     t         j                  j                  t         j                  j                        }| j	                  dt        |             y )NQuoter)r?   r@   _Quoter_ALWAYS_SAFEassertInrepr)rR   quoters     r[   test_Quoter_reprz!UrlParseTestCase.test_Quoter_repr  s2    %%fll&?&?@hV-r   c                 @    t         j                  j                          y r>   )r?   r@   clear_cacher  s    r[   "test_clear_cache_for_code_coveragez3UrlParseTestCase.test_clear_cache_for_code_coverage  s      "r   c                     | j                  t              5  t        j                  j                  }ddd       y# 1 sw Y   yxY w)z5Test that urllib.parse.__getattr__() fails correctly.N)r5  AttributeErrorr?   r@   this_does_not_exist)rR   unuseds     r[   !test_urllib_parse_getattr_failurez2UrlParseTestCase.test_urllib_parse_getattr_failure  s4    ~. 	6\\55F	6 	6 	6s	   :Ac                 D   g }h d}t        t        j                        D ]T  }|j                  d      s||v rt	        t        j                  |      }t	        |dd       dk(  sD|j                  |       V | j                  t        j                  j                  |       y )N>   unwrapsplittagto_bytes	splitattr	splithost	splitport	splittype	splituser
ResultBase
splitnport
splitquery
splitvaluer9  splitpasswdr_  r
  zurllib.parse)dirr?   r@   
startswithr  appendassertCountEqual__all__)rR   r   undocumentednamer  s        r[   test_allzUrlParseTestCase.test_all  s    
 % 	&Ds#t|';V\\40Fv|T2nD%	& 	fll22H=r   c                    d}|D ch c]  }dj                  t        |             }}t        t        t	        dt
        j                              D cg c]L  }t        j                  |      r5|t        t        j                  |      j                               z  r||vr|N }}| j                  d|       | j                  d|       t        j                  j                  d       | j                  t               5  t        j                  j                  d       d d d        dD ]  }d	D ]  }|D ]  }d
j                  ||j                  |            }| j#                  |dj                  t        |                  5  | j                  t               5  t        j                  j                  |       d d d        d d d           y c c}w c c}w # 1 sw Y   xY w# 1 sw Y   .xY w# 1 sw Y   xY w)Nz/:#?@z{:04X}   u   ℀u   ＃u   http://プ:80u   http://プ︓80)r   r   r  )znetloc{}false.netloczn{}user@netlocz{}://{}/path)rS   char)formatordmapchrr^  sys
maxunicodeunicodedatadecompositionr  rU   r4  r?   r@   rP   r5  r6  ro  )rR   illegal_charsr   	hex_charsdenorm_charsrC   rD   rS   s           r[   test_urlsplit_normalizationz,UrlParseTestCase.test_urlsplit_normalization/  s     6CDX__SV,D	D3c3>> :;
((+S!:!:1!=!C!C!EFF& 
 
 	h-h- 	67z* 	ALL!!"?@	A / 	7FD 7% 7A(//a8HIC#HOOCF4KL 7!..z: 7"LL11#677 777	7# E
	A 	A7 77 7s<   !GAG? GG1	 G%8G1	G"%G.*G1	1G:r>   ):r	  r
  r  r\   rj   rn   r   r   r   r   r   r  r  r  r#  r)  r9  rE  rG  rZ  r`  rj  rq  rv  ry  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r"  r$  r)  r,  r/  r7  r:  r?  rU  rd  r  r   r[   r<   r<   h   s@   38j77U5n;@$=LJS"A`@
%JZ7Br5&n0Nd4.M[z#tJ9Dv#&;$'*RU@&@$DV*@HBL0L2177H
R*R(U
R=.;	5&R
2
\+@*.#6
> 7r   r<   c                   X    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zy)Utility_Testsz=Testcase to test the various utility functions in the urllib.c                 (   t         j                  j                  }| j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d	      d
       y )Nztype:opaquestring)rB  opaquestringrh  )Nrh  :opaquestring)Nri  ztype:)rB  r   ztype:opaque:string)rB  zopaque:string)r?   r@   
_splittyperK   )rR   rG  s     r[   test_splittypezUtility_Tests.test_splittypeQ  s    LL++	#679QR>24JK?35LM7+\:#78:STr   c                    t         j                  j                  }| j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d	      d
       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       y )Nz%//www.example.org:80/foo/bar/baz.html)www.example.org:80/foo/bar/baz.htmlz//www.example.org:80)rm  r   rn  )Nrn  z//127.0.0.1#@host.com)	127.0.0.1/#@host.comz//127.0.0.1#@host.com:80)ro  z/#@host.com:80z//127.0.0.1:80#@host.com)z127.0.0.1:80rp  z///file)r   z/filez//example.net/file;)example.netz/file;z//example.net/file?)rq  z/file?z//example.net/file#)rq  z/file#)r?   r@   
_splithostrK   )rR   rE  s     r[   test_splithostzUtility_Tests.test_splithostY  s   LL++	#JKD	F#9:3	5#674	6 	#:;5	7#=>8	:#=>8	: 	9-&	( 	#892	4#892	4#892	4r   c                 (   t         j                  j                  }| j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d	      d
       y )NrL  )	User:Passwww.python.org:080z@www.python.org:080)r   rv  rv  )Nrv  z
User:Pass@)ru  r   rQ  )zUser@example.com:Passrv  )r?   r@   
_splituserrK   )rR   rH  s     r[   test_splituserzUtility_Tests.test_splituserv  s    LL++	#AB<	>#893	5#785	7<0*	,#MNH	Jr   c                    t         j                  j                  }| j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d	      d
       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       y )Nzuser:ab)r&  abzuser:a
b)r&  za
bzuser:a	b)r&  za	bzuser:ab)r&  zabzuser:ab)r&  zabzuser:ab)r&  zabzuser:a:b)r&  za:bzuser:a b)r&  r   z	user 2:ab)zuser 2rz  z
user+1:a+b)zuser+1za+bzuser:)r&  r   r&  )r&  Nz:ab)r   rz  )r?   r@   _splitpasswdrK   )rR   rM  s     r[   test_splitpasswdzUtility_Tests.test_splitpasswd  s+    ll//Y/@[13CD[13CD[13CD[13CD[13CDZ0/BZ0/B[13CD\24EFW-|<V,n=U+Z8r   c                    t         j                  j                  }| j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d	       | j                   |d
      d       | j                   |d      d       | j                   |d      d       y )N	parrot:88)parrot88r  r  Nparrot:ro  )ro  Nparrot:cheese)r  Nz[::1]:88)[::1]r  r  )r  Nz:88)r   r  )r?   r@   
_splitportrK   )rR   rF  s     r[   test_splitportzUtility_Tests.test_splitport  s    LL++	;/1AB8,.>?9-/?@;/1DE?35LM:.@7+_=5):6r   c                     t         j                  j                  }| j                   |d      d       | j                   |d      d       | j                   |dd      d       | j                   |d      d       | j                   |dd      d       | j                   |d      d	       | j                   |dd      d
       | j                   |d      d       | j                   |dd      d       | j                   |d      d       y )Nr~  )r  rd  r  )r  7   )r  r  r  ro  )ro  r  )ro  r  r  r  zparrot: +1_0 )r?   r@   _splitnportrK   )rR   rJ  s     r[   test_splitnportzUtility_Tests.test_splitnport  s    \\--
K0.AH-~>Hb1>BI.?Ir2NCK02CDK46GHO46FGOR8:JKO46FGr   c                     t         j                  j                  }| j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       y )	Nhttp://python.org/fake?foo=bar)http://python.org/fakefoo=barzhttp://python.org/fake?foo=bar?)r  r   r  )r  Nz?foo=bar)r   r  )r?   r@   _splitqueryrK   )rR   rK  s     r[   test_splitqueryzUtility_Tests.test_splitquery  su     \\--
$DE>	@$EF?	A$<=9	;J/Ar   c                 (   t         j                  j                  }| j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d	      d
       y )Nhttp://example.com?foo=bar#baz)http://example.com?foo=barbazzhttp://example.com?foo=bar#)r  r   z#baz)r   r  r  )r  Nz"http://example.com?foo=bar#baz#boo)r  boo)r?   r@   	_splittagrK   )rR   rB  s     r[   test_splittagzUtility_Tests.test_splittag  s    <<))"BC>	@"?@;	=&);7">?=	?"FGB	Dr   c                    t         j                  j                  }| j                   |d      dddgf       | j                   |d      ddgf       | j                   |d      dddgf       | j                   |d      dg f       y )Nz/path;attr1=value1;attr2=value2r'  zattr1=value1zattr2=value2z/path;r   z;attr1=value1;attr2=value2)r?   r@   
_splitattrrK   )rR   rD  s     r[   test_splitattrzUtility_Tests.test_splitattr  s    LL++	#DE!NN#CD	F8,wo>#?@~~>?	A7+gr];r   c                 (   t         j                  j                  }| j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |d	      d
       y )Nr  )r'  barzfoo=)r'  r   z=bar)r   r  foobar)r  Nzfoo=bar=baz)r'  zbar=baz)r?   r@   _splitvaluerK   )rR   rL  s     r[   test_splitvaluezUtility_Tests.test_splitvalue  s~     \\--
I.?F+[9F+[9H-/?@M24FGr   c                     t         j                  j                  d      }| j                  |d       | j	                  t
        t         j                  j                  d       y )Nzhttp://www.python.orgu   http://www.python.org/mediæval)r?   r@   	_to_bytesrK   r5  UnicodeErrorr  s     r[   test_to_byteszUtility_Tests.test_to_bytes  sH    ''(?@!89,(>(>?	Ar   c                 t    dD ]3  }t         j                  j                  |      }| j                  |d       5 y )N)z<URL:scheme://host/path>z<scheme://host/path>zURL:scheme://host/pathscheme://host/pathr  )r?   r@   rA  rK   )rR   wrapped_urlrS   s      r[   test_unwrapzUtility_Tests.test_unwrap  s9    L 	8K,,%%k2CS"67	8r   N)r	  r
  r  __doc__rk  rs  rx  r|  r  r  r  r  r  r  r  r  r  r   r[   rf  rf  M  sH    GU4:J9$	7H
B
D<HA8r   rf  c                   T    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zy)DeprecationTestc                 *   | j                  t              5 }t        j                  j                  }| j                  |t        j                  j                         d d d        | j                  dt        j                               y # 1 sw Y   /xY w)NzQuoter will be removed)
assertWarnsDeprecationWarningr?   r@   r1  r  r2  r4  strwarning)rR   cm	old_classs      r[   test_Quoter_deprecationz'DeprecationTest.test_Quoter_deprecation  sh    01 	;R++IMM)V\\%9%9:	; 	.BJJ@	; 	;s   AB		Bc                     | j                  t              5 }t        j                  j	                  d       d d d        | j                  t        j                        d       y # 1 sw Y   /xY w)Nr   zUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r?   r@   rG  rK   r  r  rR   r  s     r[   test_splittype_deprecationz*DeprecationTest.test_splittype_deprecation  X    01 	'RLL""2&	'RZZ?	@	' 	'    A$$A-c                     | j                  t              5 }t        j                  j	                  d       d d d        | j                  t        j                        d       y # 1 sw Y   /xY w)Nr   zUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r?   r@   rE  rK   r  r  r  s     r[   test_splithost_deprecationz*DeprecationTest.test_splithost_deprecation  r  r  c                     | j                  t              5 }t        j                  j	                  d       d d d        | j                  t        j                        d       y # 1 sw Y   /xY w)Nr   zUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r?   r@   rH  rK   r  r  r  s     r[   test_splituser_deprecationz*DeprecationTest.test_splituser_deprecation  r  r  c                     | j                  t              5 }t        j                  j	                  d       d d d        | j                  t        j                        d       y # 1 sw Y   /xY w)Nr   zWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r?   r@   rM  rK   r  r  r  s     r[   test_splitpasswd_deprecationz,DeprecationTest.test_splitpasswd_deprecation  sX    01 	)RLL$$R(	)RZZ?	@	) 	)r  c                     | j                  t              5 }t        j                  j	                  d       d d d        | j                  t        j                        d       y # 1 sw Y   /xY w)Nr   zUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r?   r@   rF  rK   r  r  r  s     r[   test_splitport_deprecationz*DeprecationTest.test_splitport_deprecation	  r  r  c                     | j                  t              5 }t        j                  j	                  d       d d d        | j                  t        j                        d       y # 1 sw Y   /xY w)Nr   zVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r?   r@   rJ  rK   r  r  r  s     r[   test_splitnport_deprecationz+DeprecationTest.test_splitnport_deprecation  X    01 	(RLL##B'	(RZZ?	@	( 	(r  c                     | j                  t              5 }t        j                  j	                  d       d d d        | j                  t        j                        d       y # 1 sw Y   /xY w)Nr   zVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r?   r@   rK  rK   r  r  r  s     r[   test_splitquery_deprecationz+DeprecationTest.test_splitquery_deprecation  r  r  c                     | j                  t              5 }t        j                  j	                  d       d d d        | j                  t        j                        d       y # 1 sw Y   /xY w)Nr   zTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r?   r@   rB  rK   r  r  r  s     r[   test_splittag_deprecationz)DeprecationTest.test_splittag_deprecation  sX    01 	&RLL!!"%	&RZZ?	@	& 	&r  c                     | j                  t              5 }t        j                  j	                  d       d d d        | j                  t        j                        d       y # 1 sw Y   /xY w)Nr   zUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r?   r@   rD  rK   r  r  r  s     r[   test_splitattr_deprecationz*DeprecationTest.test_splitattr_deprecation%  r  r  c                     | j                  t              5 }t        j                  j	                  d       d d d        | j                  t        j                        d       y # 1 sw Y   /xY w)Nr   zWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() instead)r  r  r?   r@   rL  rK   r  r  r  s     r[   test_splitvalue_deprecationz+DeprecationTest.test_splitvalue_deprecation,  sY    01 	(RLL##B'	(RZZ@	A	( 	(r  c                     | j                  t              5 }t        j                  j	                  d       d d d        | j                  t        j                        d       y # 1 sw Y   /xY w)Nr   z/urllib.parse.to_bytes() is deprecated as of 3.8)r  r  r?   r@   rC  rK   r  r  r  s     r[   test_to_bytes_deprecationz)DeprecationTest.test_to_bytes_deprecation3  sV    01 	&RLL!!"%	&RZZJ	L	& 	&r  N)r	  r
  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r[   r  r    sJ    A@@@@@@@@@ALr   r  __main__)r]  r_  unittesturllib.parser?   r  r  r"  r(  rb   rl   TestCaser<   rf  r  r	  mainr  r   r[   <module>r     s   
   %##
)H)"I) 
2J) 	8*	)
 
I;) 	9+) 
I;) |n) ) Z()) >"#) j\) \<01) Z()) 	"I)  
2J!)" BK#)$ 
J<%)& [M')( 
K=))* [M+),  -). .!"/)0 ,-.1)2 $%&3)4 |n5)6 nn567)8 ,-.9): k];)< '()=)> }o?)@ *+,A)D '()E)F )*+G)H %&'I)J 678K)L 234M)N &'(O)P $%&Q) \*H*"I* 
2J* 	2t*	*
 
B;* 	3+* 
C";* sUGn* * se3%()* 3	"#* cC5\* 5'01* sCj!"* 	"I*  
2J!*" BK#*$ 
C#<%*& S4&M'*( 
D3%=)** TC5M+*, vh -*. &4&!"/*0 tf-.1*2 D8*%&3*4 tdVn5*6 VHVH567*8 $t%&9*: dSE];*< S;-()=*> utfo?*@ d\?+,A*B 0123C*F Xx()G*H x&*+I*J H:&'K*L K+78M*N k]34O*P GgY'(Q*R 'G9%&S* Xc7x(( c7J'U8H%% U8pRLh'' RLj zHMMO r   