
    <eA                       d dl Z d dlZd dlZd dlZdZdZdZdZ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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$d%gfd&d'd(gfd)d*gfd+d,gfd-d.gfd/d0gfgZ	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d1gifdd2gd3gdfddd4d5g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d6gifd#d7gd8gd"fd&dd9d:gifd)d;d1gifd+dd<gifd-d=d6gifd/dd>gifgZ
 G d? d@ej                  Z G dA dBej                  Z G dC dDej                  ZedEk    r ej                     dS dS )F    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r	   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r      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 cr   r   r   r   r   r   r   r   r   r!   r#   r%   r'   r)   c                   @   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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. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4S )5UrlParseTestCasec                 	   t           j                            |          }|                     ||           |j        |j        |j        |j        |j        |j	        f}|                     ||           t           j        
                    |          }|                     ||           |                     ||                                           t           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	        f}|                     ||           t           j                            |          }|                     ||           |                     ||                                           t           j                            |                                          }|                     |                                |                                           |                     ||           |                     |j        |j                   |                     |j        |j                   |                     |j        |j                   |                     |j        |j                   |                     |j	        |j	                   |                     |j        |j                   |                     |j        |j                   |                     |j        |j                   |                     |j        |j                   d S N)urllibparseurlparseassertEqualschemenetlocpathparamsqueryfragment
urlunparsegeturlusernamepasswordhostnameporturlsplit
urlunsplit)selfurlparsedsplitresulttresult2result3s           )/usr/lib/python3.11/test/test_urlparse.pycheckRoundtripsz UrlParseTestCase.checkRoundtripsI   s   &&s++(((]FM6;]FL&/;F###,))&11#&&&&--//222 ,''88))6==??;;;62226=9996=9996;7776=9996<888)6?;;;)6?;;;)6?;;;)6?;;;6;777 &&s++''']FM6;\6?,E""",))&11#&&&&--//222 ,''88))6==??;;;62226=9996=9996;7776<888)6?;;;)6?;;;)6?;;;)6?;;;6;77777r   c                 $   t           D ]\  }}t          j                            |d          }|                     ||d|z             d |D             }t          j                            |d          }|                     ||d|z             d S )NTkeep_blank_valuesError parsing %rc                 <    g | ]}t          |d                    |S )   len).0vs     rH   
<listcomp>z-UrlParseTestCase.test_qsl.<locals>.<listcomp>   s'    $D$D$D1#ad))$DQ$D$D$Dr   F)parse_qsl_test_casesr.   r/   	parse_qslr1   )r@   origexpectrD   expect_without_blankss        rH   test_qslzUrlParseTestCase.test_qsl|   s    0 	7 	7LD&\++DD+IIFVV-?$-FGGG$D$D$D$D$D!\++DE+JJFV%:.57 7 7 7	7 	7r   c                 *   t           D ]\  }t          j                            |d          }|                     |d|z             fdD             }t          j                            |d          }|                     ||d|z             d S )NTrK   rM   c                 X    i | ]&}t          |         d                    ||         'S )r   rP   )rR   rS   rX   s     rH   
<dictcomp>z,UrlParseTestCase.test_qs.<locals>.<dictcomp>   sJ     %K %K %K)*F1IaL8I8I%KQq	 %K %K %Kr   F)parse_qs_test_casesr.   r/   parse_qsr1   )r@   rW   rD   rY   rX   s       @rH   test_qszUrlParseTestCase.test_qs   s    / 	7 	7LD&\**44*HHFVV-?$-FGGG%K %K %K %K.4%K %K %K!\**45*IIFV%:.57 7 7 7	7 	7r   c                 x    g d}d fd|D             }||z   D ]\  }}}|                      |||           d S )N))zfile:///tmp/junk.txt)filer   /tmp/junk.txtr   r   r   )rb   r   rc   r   r   )zimap://mail.python.org/mbox1)imapmail.python.org/mbox1r   r   r   )rd   re   rf   r   r   )z1mms://wms.sys.hinet.net/cts/Drama/09006251100.asf)mmswms.sys.hinet.net/cts/Drama/09006251100.asfr   r   r   )rg   rh   ri   r   r   )znfs://server/path/to/file.txt)nfsserver/path/to/file.txtr   r   r   )rj   rk   rl   r   r   )z0svn+ssh://svn.zope.org/repos/main/ZConfig/trunk/)svn+sshsvn.zope.org/repos/main/ZConfig/trunk/r   r   r   )rm   rn   ro   r   r   )z)git+ssh://git@github.com/user/project.git)git+sshgit@github.com/user/project.gitr   r   r   )rp   rq   rr   r   r   c                     | d                              d          t          d | d         D                       t          d | d         D                       fS )Nr   asciic              3   @   K   | ]}|                     d           V  dS rt   NencoderR   xs     rH   	<genexpr>zDUrlParseTestCase.test_roundtrips.<locals>._encode.<locals>.<genexpr>   .      ::!((7++::::::r   rO   c              3   @   K   | ]}|                     d           V  dS rv   rw   ry   s     rH   r{   zDUrlParseTestCase.test_roundtrips.<locals>._encode.<locals>.<genexpr>   r|   r      rx   tuplerE   s    rH   _encodez1UrlParseTestCase.test_roundtrips.<locals>._encode   [    aDKK((::QqT:::::::QqT:::::< <r   c                 &    g | ]} |          S  r   rR   rz   r   s     rH   rT   z4UrlParseTestCase.test_roundtrips.<locals>.<listcomp>   !    555awwqzz555r   rI   )r@   	str_casesbytes_casesrA   rB   rC   r   s         @rH   test_roundtripsz UrlParseTestCase.test_roundtrips   s~      	4	< 	< 	< 65559555"+k"9 	5 	5C  fe4444	5 	5r   c                     g d}d fd|D             }d}d}||f}||f}||fD ];\  }}|D ]3}	|D ].\  }
}}|	|
z   }
|	f|z   }|	f|z   }|                      |
||           /4<d S )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                              d          t          d | d         D                       t          d | d         D                       fS )Nr   rt   c              3   @   K   | ]}|                     d           V  dS rv   rw   ry   s     rH   r{   zIUrlParseTestCase.test_http_roundtrips.<locals>._encode.<locals>.<genexpr>   r|   r   rO   c              3   @   K   | ]}|                     d           V  dS rv   rw   ry   s     rH   r{   zIUrlParseTestCase.test_http_roundtrips.<locals>._encode.<locals>.<genexpr>   r|   r   r~   r   r   s    rH   r   z6UrlParseTestCase.test_http_roundtrips.<locals>._encode   r   r   c                 &    g | ]} |          S r   r   r   s     rH   rT   z9UrlParseTestCase.test_http_roundtrips.<locals>.<listcomp>   r   r   )httphttps)   http   httpsr   )r@   r   r   str_schemesbytes_schemes	str_testsbytes_testsschemes
test_casesr2   rA   rB   rC   r   s                @rH   test_http_roundtripsz%UrlParseTestCase.test_http_roundtrips   s      	"	< 	< 	< 65559555'+*	#[0$-{#; 	= 	=GZ! = =*4 = =&C 3,C$Y/F#I-E((fe<<<<	==	= 	=r   c                    |||f}|                      t          j                            ||          |           d |D             x}\  }}}|                      t          j                            ||          |           d S )Nc                 8    g | ]}|                     d           S rt   rw   ry   s     rH   rT   z.UrlParseTestCase.checkJoin.<locals>.<listcomp>   s7     8G 8G 8G23AHHW--8G 8G 8Gr   )r1   r.   r/   urljoin)	r@   baserelurlexpectedstr_componentsbytes_componentsbasebrelurlb	expectedbs	            rH   	checkJoinzUrlParseTestCase.checkJoin   s    1--dF;;XFFF8G 8G7E8G 8G 8G 	G45'9--eW==yIIIIIr   c                 v   g d}d |D             }||z   D ]}|                      t          j                            t          j                            |                    |           |                      t          j                            t          j                            |                    |           d S )N)Pythonz./Pythonx-newscheme://foo.com/stuffzx://yzx:/yzx:/r   c                 8    g | ]}|                     d           S r   rw   ry   s     rH   rT   z7UrlParseTestCase.test_unparse_parse.<locals>.<listcomp>   $    <<<Qqxx((<<<r   )r1   r.   r/   r?   r>   r8   r0   )r@   r   r   us       rH   test_unparse_parsez#UrlParseTestCase.test_unparse_parse   s    bbb	<<)<<<[( 	S 	SAV\44V\5J5J15M5MNNPQRRRV\44V\5J5J15M5MNNPQRRRR	S 	Sr   c                    |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          d	d
           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          d d           |                      t          d!d"           |                      t          d#d$           |                      t          d%d$           |                      t          d&d           |                      t          d'd(           |                      t          d)d*           |                      t          d+d,           |                      t          d-d.           |                      t          d/d0           |                      t          d1d"           |                      t          d2d           |                      t          d3d4           |                      t          d5d6           d S )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r@   s    rH   test_RFC1808zUrlParseTestCase.test_RFC1808   s   |UE222|S*:;;;|U,<===|T+<===|T<888|UJ777|U,>???|Y0FGGG|T+ABBB|U,>???|Y0FGGG|W.BCCC|U,>???|Y0FGGG|S/:::|T?;;;|T=999|UM:::|V^<<<|Wk:::|X{;;;|Y=== 	|R)?@@@|T+<===|T+<===|U,>???|U,>???|X~>>>|W.?@@@|W.@AAA|X/?@@@@@r   c                 l    |                      t          j                            d          d           d S )Nzmailto:1337@example.org)mailtor   z1337@example.orgr   r   r   r1   r.   r/   r0   r   s    rH   test_RFC2368zUrlParseTestCase.test_RFC2368  s?    ../HII>	@ 	@ 	@ 	@ 	@r   c                    |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          d	d
           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd            |                      t          d!d            |                      t          d"d           |                      t          d#t                     |                      t          d$d%           |                      t          d&d'           |                      t          d(d)           |                      t          d*d+           |                      t          d,d           |                      t          d-d           |                      t          d.d/           |                      t          d0d1           |                      t          d2d3           |                      t          d4d5           |                      t          d6d7           |                      t          d8d9           |                      t          d:d;           |                      t          d<d=           d S )>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    rH   test_RFC2396zUrlParseTestCase.test_RFC2396  s"    	|UE222|S*:;;;|U,<===|T+<===|T<888|UJ777|U,>???|T+ABBB|U,>???|W.BCCC|U,>???|Y0FGGG|S/:::|T?;;;|T=999|UM:::|V^<<<|Wk:::|X{;;;|Y===|R666|T+<===|T+<===|U,>???|U,>???|X~>>>|W.?@@@|W.@AAA|X/?@@@|[2HIII|\3CDDD|Y0FGGG|Z1HIII|Y0FGGG|Z1HIIIIIr   c                 
   |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          d	d
           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          d d!           |                      t          d"d!           |                      t          d#d$           |                      t          d%d&           |                      t          d'd&           |                      t          d(d           |                      t          d)d           |                      t          d)d           |                      t          d*d           |                      t          d+d           |                      t          d,d           |                      t          d-d.           |                      t          d/d0           |                      t          d1d2           |                      t          d3d4           |                      t          d5d$           |                      t          d6d
           |                      t          d7d8           |                      t          d9d:           |                      t          d;d<           |                      t          d=d>           |                      t          d?d@           |                      t          dAdB           |                      t          dCdD           |                      t          dEdF           |                      t          dGd           |                      dHdd           d S )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    rH   test_RFC3986zUrlParseTestCase.test_RFC3986H  s   |T*>???|T+<===|U5111|S)9:::|U+;<<<|T*;<<<|T,777|U:666|T*>???|U+=>>>|T*@AAA|U+=>>>|W-ABBB|T*;<<<|U+=>>>|Y/EFFF|R(<===|S999|T/:::|T-888|U=999|VN;;;|W[999|Xk:::|Y|<<<|\<@@@ 	|\,???|_\BBB|VL999|W\:::|T*;<<<|T*;<<<|U+=>>>|U+=>>>|Xn===|W->???|W-?@@@|X.>???|[1GHHH|\2BCCC|Y/EFFF|Z0GHHH|Y/EFFF|Z0GHHH|X.>??? 	($/@AAAAAr   c                    |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd	           |                      t          d
d           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          dd           |                      t          d d	           |                      t          d!d"           |                      t          d#d$           |                      t          dd           |                      t          dd           |                      t          d%d           |                      t          d&d           |                      t          d'd           |                      d(dd(           |                      d)dd           |                      d)d*d*           |                      d+d,d-           |                      d.d,d/           |                      d0dd1           |                      d2dd3           |                      t          d4z   d5t          d6z              |                      d7d8d9           |                      d:d8d;           |                      d7d<d=           |                      d:d<d=           |                      d7d>d?           |                      dd8d=           |                      d@dAdA           d S )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    rH   test_urljoinszUrlParseTestCase.test_urljoins  s   {E%000{H-=>>>{G,<==={C(8999{E*:;;;{D):;;;{D666{E*555{D);<<<{E*<==={I.DEEE{C888{D999{D777{E-888{F>:::{GK888{Il;;;{H^<<<{G,=>>>{G,>???{H-=>>>{H-=>>>{G,<==={I.@AAA{J/ABBB{N3IJJJz4
333r12HIIIr>>:::.8OPPP2F<WXXXz#j111{3{333 	{S(%v1EFFF 	*L:MNNN)<9JKKK*M?KKK)=/JJJ*K9KLLL}lODDD 	sC%%%%%r   c                 V   g d}d fd|D             }||z   D ]I\  }}}t           j                            |          }|                     |j        |j        f||f           Jg d}d |D             }||z   D ]-}|                     t          t           j        j        |           .d S )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/r  N)z5http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/r  N)zhttp://[::12.34.56.78]/foo/r  N)z http://[::ffff:12.34.56.78]/foo/r  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/r  N)z6http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]:/foo/r  N)zhttp://[::12.34.56.78]:/foo/r  N)z!http://[::ffff:12.34.56.78]:/foo/r  Nc                 |    | d                              d          | d                              d          | d         fS )Nr   rt   rO   r~   rw   r   s    rH   r   z.UrlParseTestCase.test_RFC2732.<locals>._encode  s3    Q4;;w''1W)=)=qtCCr   c                 &    g | ]} |          S r   r   r   s     rH   rT   z1UrlParseTestCase.test_RFC2732.<locals>.<listcomp>  r   r   )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.78c                 8    g | ]}|                     d           S r   rw   ry   s     rH   rT   z1UrlParseTestCase.test_RFC2732.<locals>.<listcomp>  r   r   )r.   r/   r0   r1   r<   r=   assertRaises
ValueError)	r@   r   r   rA   r<   r=   	urlparsedinvalid_urlr   s	           @rH   test_RFC2732zUrlParseTestCase.test_RFC2732  s     	@	D 	D 	D55559555#,{#: 	V 	VC4--c22Ii0).AXtDTUUUU. . .	 =<)<<<${2 	N 	NKj&,*?MMMM	N 	Nr   c                    ddddddddt           d	d
ft          d	dfg
}d fd|D             }||z   D ]\  }}}t          j                            |          }|                     |                                |           |                     |||f           |                     |j        |           |                     |j        |           d S )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                 F     t          |           d | D                       S )Nc              3   @   K   | ]}|                     d           V  dS rv   rw   ry   s     rH   r{   zCUrlParseTestCase.test_urldefrag.<locals>._encode.<locals>.<genexpr>  s.      88188G,,888888r   )typer   s    rH   r   z0UrlParseTestCase.test_urldefrag.<locals>._encode  s'    47788a888888r   c                 &    g | ]} |          S r   r   r   s     rH   rT   z3UrlParseTestCase.test_urldefrag.<locals>.<listcomp>  r   r   )	r   r   r.   r/   	urldefragr1   r9   rA   r7   )r@   r   r   rA   defragr  rD   r   s          @rH   test_urldefragzUrlParseTestCase.test_urldefrag  s   C:E<I@GB/5/4
		9 	9 	955559555!*[!8 	4 	4C\++C00FV]]__c222Vfd^444VZ000V_d3333	4 	4r   c                 Z   t           j                            d          }|                     |j        d           |                     |j        d           t           j                            d          }|                     |j        d           |                     |j        d           d S )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/   r>   r1   r<   r3   )r@   r   s     rH   test_urlsplit_scoped_IPv6z*UrlParseTestCase.test_urlsplit_scoped_IPv6  s    L!!"PQQ%EFFF#JKKKL!!"QRR%FGGG#KLLLLLr   c                    d}t           j                            |          }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j	        d            |                     |j
        d            |                     |j        d           |                     |j        d            |                     |                                dd          |dd                     d	}t           j                            |          }|                     |j        d           |                     |j        d
           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j	        d           |                     |j
        d           |                     |j        d           |                     |j        d           |                     |                                |           d}t           j                            |          }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j	        d           |                     |j
        d           |                     |j        d           |                     |j        d           |                     |                                |           d}t           j                            |          }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j	        d            |                     |j
        d            |                     |j        d           |                     |j        d            |                     |                                dd          |dd                     d}t           j                            |          }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j	        d           |                     |j
        d           |                     |j        d           |                     |j        d           |                     |                                |           d}t           j                            |          }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j	        d            |                     |j
        d           |                     |j        d           |                     |j        d           |                     |                                |           d!}t           j                            |          }|                     t          d"          5  |j         d d d            d S # 1 swxY w Y   d S )#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/   r>   r1   r2   r3   r4   r6   r7   r:   r;   r<   r=   r9   assertRaisesRegexr  )r@   rA   r   s      rH   test_urlsplit_attributesz)UrlParseTestCase.test_urlsplit_attributes
  s4   /L!!#&&6***#3444)))"%%%V,,,T***T***%5666&&& 	ABBQRR111GL!!#&&6***#ABBB)))+...V,,,V,,,V,,,%5666$$$S))) TL!!#&&6***#MNNN)))+...V,,,%7888V,,,%5666$$$S))) 1L!!#&&7+++#4555***#&&&W---T***T***%6777&&&ABBQRR111HL!!#&&7+++#BCCC***,///W---W---W---%6777$$$S)))TL!!#&&7+++#NOOO***,///W---%8999W---%6777$$$S))) 7L!!#&&##J?? 	 	FF	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   __!_c                    d}t           j                            |          }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j	        d            |                     |j
        d            |                     |j        d           |                     |j        d            |                     |                                d           d}t           j                            |          }|                     |j        d	           |                     |j        d
           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j	        d            |                     |j
        d            |                     |j        d
           |                     |j        d            |                     |                                d           d}d}t          d          D ]f}t           j                            ||          }|                     |j        d           |                     |                                d           gd S )NzQhttp	://www.python
.org	/java
script:	alert('msg
')/?query
=	something#frag
mentr   r   z/javascript:alert('msg')/zquery=somethingr7   zGhttp://www.python.org/javascript:alert('msg')/?query=something#fragmentsQ   http	://www.python
.org	/java
script:	alert('msg
')/?query
=	something#frag
mentr   r6  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~   r2   )r.   r/   r>   r1   r2   r3   r4   r6   r7   r:   r;   r<   r=   r9   range)r@   rA   r   r2   _s        rH   !test_urlsplit_remove_unsafe_bytesz2UrlParseTestCase.test_urlsplit_remove_unsafe_bytesg  s   kL!!#&&6***#3444!<==="3444Z000T***T***%5666&&&%nooo mL!!#&&7+++#4555!=>>>"4555[111T***T***%6777&&&%oppp fq 	t 	tA%%c&%99AQXv...QXXZZ)rssss	t 	tr   c                 n	   t          t          dd                    }d}|                    d          |z   }t          j                            |          }|                     |j        d           |                     |j        d           |                     |j	        d           |                     |j
        d           |                     |j        d	           |                     |j        d
           |                     |j        d           |                     |j        d           |                     |j        d           |                     |                                |           ||                    d          z   }t          j                            |          }|                     |j        d           |                     |j        d           |                     |j	        d           |                     |j
        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |                                |                    d                     d}t          j                            |                    d          |z             }|                     |j        d           |                     |j        d           |                     |j	        d           |                     |j
        d           |                     |j        d           |                     |                                |           t          j                            d          }|                     t          j                            |          d           d}|                    d          dz   |                    d          z   }t          d          D ]f}t          j                            ||          }|                     |j        d           |                     |                                d           gd S ) Nr   !   r-  utf-8r   r.  r+  r/  r  r0  r1  r   r2  r   r7  r4  r8  r5  r9  r:  r6  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/   r>   r1   r2   r3   r4   r6   r7   r:   r;   r<   r=   r9   rx   r?   )r@   noisebase_urlrA   r   query_spaces_urlr2   rA  s           rH   test_urlsplit_strip_urlz(UrlParseTestCase.test_urlsplit_strip_url  s   eAx(())Lll7##h.L!!#&&6***#ABBB)))+...V,,,V,,,V,,,%5666$$$X...hoog...L!!#&&7+++#BCCC***,///W---W---W---%6777$$$X__W%=%=>>> GL!!%,,w"7"7:J"JKK7+++#6777))),///$$$%5666L!!/22 	0033_EEE "g&&05<<3H3HHq 	D 	DA%%c&%99AQXw///QXXZZ)BCCCC	D 	Dr   c           
      l   dD ]/}t           j        j        t           j        j        fD ]}dD ]}|                     |||          5  d|z   }d|z   dz   }|r`|                                r?|                                r+|                    d          }|                    d          }n	 ddd            ||          }|                     |j        |           | 	                    t                    5  |j         ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y   
1dS )	z Check handling of invalid ports.FT)	r  z1.5z-10x10z-01_1z 1z1 u   ६)rG  r/   r=   zwww.example.net:zhttp://r   rt   N)r.   r/   r>   r0   subTestisasciirx   r1   r3   r  r  r=   )r@   rG  r/   r=   r3   rA   r   s          rH   test_attributes_bad_portz)UrlParseTestCase.test_attributes_bad_port  s   " 	# 	#E ,/1FG # #X # #DETJJ # #!3d!:'&036  )%~~// )DLLNN ))/w)?)?&)jj&9&9 (# # # # # # # "E#JJ((6:::!..z:: # #FF# # # # # # # # # # # # # # ## # # # # # # # # # # # # # ###	# 	#s>   A$D#	8A D#	8D D#	DD#	DD#	#D'*D'c           	         dD ]}t           j        j        t           j        j        fD ]}dD ]}|                     |||          5  |dz   }|r7|                                r|                    d          }n	 ddd           Y ||          }|r|                     |j        d           n|                     |j        d           ddd           n# 1 swxY w Y   dS )	z"Check handling of invalid schemes.rN  )r   +-0zhttp&u   ६http)rG  r/   r2   z://www.example.netrt   Nr   r   )	r.   r/   r>   r0   rQ  rR  rx   r1   r2   )r@   rG  r/   r2   rA   r   s         rH   test_attributes_bad_schemez+UrlParseTestCase.test_attributes_bad_scheme  sf   " 	; 	;E ,/1FG ; ;F ; ;FEvNN ; ;$';;  )"{{}} )&)jj&9&9 (; ; ; ; ; ; ; "E#JJ  ; ,,QXs;;;; ,,QXr:::; ; ; ; ; ; ; ; ; ; ; ; ; ; ;;;	; 	;s   3C	AC	CCc                 ~   d}t           j                            |          }|                     |j        d           |                     |j        d            |                     |j        d            |                     |j        d            |                     |j        d            |                     |	                                |           t           j        
                    |          }|                     |j        d           |                     |j        d            |                     |j        d            |                     |j        d            |                     |j        d            |                     |	                                |           d}t           j                            |          }|                     |j        d           |                     |j        d            |                     |j        d            |                     |j        d            |                     |j        d            |                     |	                                |           t           j        
                    |          }|                     |j        d           |                     |j        d            |                     |j        d            |                     |j        d            |                     |j        d            |                     |	                                |           d S )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/   r>   r1   r3   r:   r;   r<   r=   r9   r0   )r@   urir   s      rH   test_attributes_without_netlocz/UrlParseTestCase.test_attributes_without_netloc  s    AL!!#&&2&&&T***T***T***&&&S)))L!!#&&2&&&T***T***T***&&&S))) BL!!#&&3'''T***T***T***&&&S)))L!!#&&3'''T***T***T***&&&S)))))r   c                     |                      t          j                            d          d           |                      t          j                            d          d           d S )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    rH   test_noslashzUrlParseTestCase.test_noslash  sp    ../QRRM	O 	O 	O../RSSS	U 	U 	U 	U 	Ur   c                 j   |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d	          d
           |                      t          j                            d          d           d S )Nr4   )r   r   r4   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   rb  r   r   r   s   //www.python.org:80)r      www.python.org:80r   r   r   r      http://www.python.org:80r   rc  r   r   r   r   r   r   s    rH   test_withoutschemez#UrlParseTestCase.test_withoutscheme  s'   
 	..v66'	) 	) 	)../DEE4	6 	6 	6../IJJ8	: 	: 	: 	..w77-	/ 	/ 	/../EFF:	< 	< 	<../JKK>	@ 	@ 	@ 	@ 	@r   c                    |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d	          d
           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           d S )Nzhttp:80)r   r   80r   r   r   zhttps:80)r   r   rh  r   r   r   zpath:80)r4   r   rh  r   r   r   r  )r   r   r   r   r   r   zhttps:)r   r   r   r   r   r   r`  ra  s   http:80)r   r      80r   r   r   s   https:80)r   r   ri  r   r   r   s   path:80)rb  r   ri  r   r   r   s   http:)r   r   r   r   r   r   s   https:)r   r   r   r   r   r   rd  re  r   r   s    rH   test_portseparatorz#UrlParseTestCase.test_portseparator/  s   ..y99;TUUU..z::<VWWW..y99;TUUU..w778OPPP..x889QRRR../IJJ8	: 	: 	: 	..z::<[\\\..{;;=]^^^..z::<[\\\..x889VWWW..y99:XYYY../JKK>	@ 	@ 	@ 	@ 	@r   c                 \    |                      t          t          j        j        d           d S )Nr  )r  	TypeErrorr.   r/   	urlencoder   s    rH   test_usingsyszUrlParseTestCase.test_usingsysA  s%    )V\%;UCCCCCr   c                 6   |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d	          d
           |                      t          j                            d          d           |                      t          j                            d          d           |                      t          j                            d          d           d S )Nzs3://foo.com/stuff)s3foo.com/stuffr   r   r   r   )x-newschemerq  rr  r   r   r   z*x-newscheme://foo.com/stuff?query#fragment)rs  rq  rr  r   r6   r7   z!x-newscheme://foo.com/stuff?query)rs  rq  rr  r   r6   r   s   s3://foo.com/stuff)s   s3   foo.com   /stuffr   r   r   s   x-newscheme://foo.com/stuff)   x-newschemert  ru  r   r   r   s*   x-newscheme://foo.com/stuff?query#fragment)rv  rt  ru  r      queryr>  s!   x-newscheme://foo.com/stuff?query)rv  rt  ru  r   rw  r   r   r   s    rH   test_anyschemezUrlParseTestCase.test_anyschemeE  s   ../CDD@	B 	B 	B../LMMI	K 	K 	K../[\\V	X 	X 	X../RSSN	P 	P 	P 	../DEEF	H 	H 	H../MNNO	Q 	Q 	Q../\]]\	^ 	^ 	^../STTT	V 	V 	V 	V 	Vr   c                    t           j        j        t           j        j        fD ]]}|                     |          5   |dd          }|                     |j        d            |dd          }|                     |j        d           |                      |dd          j        d           |                      |dd	          j        d           |                      |d
d	          j        d           |                      |d          j        d           |                      |d
          j        d           |                      |d
d          j        d           d d d            n# 1 swxY w Y   _d S )N)functionzhttp://example.net/ftpr   s   http://example.net/s   ftpr   r4   r?  rb  r   r   )r.   r/   r0   r>   rQ  r1   r2   )r@   funcrD   s      rH   test_default_schemez$UrlParseTestCase.test_default_schemeZ  s   \*FL,AB 	@ 	@Dt,, 
@ 
@3U;;  7774f==  888  fe!4!4!;UCCC  fU!;!;!;!BEJJJ  gf!=!=!=!DfMMM  f!4b999  g!5s;;;  gr!2!2!93???
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@	@ 	@s   D-E55E9	<E9	c           
      `   d}|D ]\  }}}t           j        j        t           j        j        fD ]|}|dk    r|t           j        j        u rd}|                     ||          5   ||d          }|                     |j        d           |                     t          ||          	                    d|z                        |                      ||dd          j        d            ||d	          }|                     |j        |           | 
                    t          ||          	                    |                     |                      ||dd	          j        |           |                      ||          j        |           d d d            n# 1 swxY w Y   ~d S )
N)
)z
http:#fragr4   r  )z//example.net#fragr4   r  )zindex.html#fragr4   r  )z	;a=b#fragr5   r  )z	?a=b#fragr6   r  )z#fragr4   r  )z	abc#@fragr4   @frag)z//abc#@fragr4   r  )z//abc:80#@fragr4   r  )z//abc#@frag:80r4   z@frag:80r5   r4   )rA   rz  F)allow_fragmentsr   #T)r.   r/   r0   r>   rQ  r1   r7   
assertTruegetattrendswithassertFalse)r@   testsrA   attrexpected_fragr|  rD   s          rH   test_parse_fragmentsz%UrlParseTestCase.test_parse_fragmentsi  s.   
 ). 	H 	H$C}.0EF H H8##0E(E(E!D\\cD\99 H H!T#u===F$$V_b999OO#FD11::3;NOOQ Q Q$$TT#r5%9%9%BBGGG!T#t<<<F$$V_mDDD$$#FD11::=IIK K K$$TT#r4%8%8%A%24 4 4$$TT#YY%7GGGH H H H H H H H H H H H H H HH	H 	Hs   #D0FF#&F#c                 |   |                      t          d          5  t          j                            dd           d d d            n# 1 swxY w Y   |                      t          d          5  t          j                            dd           d d d            n# 1 swxY w Y   |                      t          d          5  t          j                            dd           d d d            n# 1 swxY w Y   |                      t          d          5  t          j                            dd           d d d            n# 1 swxY w Y   |                      t          d          5  t          j                            d           d d d            n# 1 swxY w Y   |                      t          d          5  t          j                            d           d d d            n# 1 swxY w Y   |                      t          d          5  t          j                            d           d d d            n# 1 swxY w Y   |                      t          d          5  t          j                            d	           d d d            n# 1 swxY w Y   |                      t          d          5  t          j                            d
d           d d d            n# 1 swxY w Y   |                      t          d          5  t          j                            dd
           d d d            d S # 1 swxY w Y   d S )NzCannot mix strr   r   r6  r   )r   r   r   r   r   r   )r   r6  r   r   r   r   )r   r   r   r   r   )r   r6  r   r   r   r  s   http://python.org)	r;  rl  r.   r/   r0   r>   r8   r?   r   r   s    rH   test_mixed_types_rejectedz*UrlParseTestCase.test_mixed_types_rejected  s    ##I/?@@ 	= 	=L!!"2G<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=##I/?@@ 	= 	=L!!"3V<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=##I/?@@ 	= 	=L!!"2G<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=##I/?@@ 	= 	=L!!"3V<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=##I/?@@ 	N 	NL##$LMMM	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N##I/?@@ 	M 	ML##$KLLL	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M##I/?@@ 	J 	JL##$HIII	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J##I/?@@ 	J 	JL##$HIII	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J##I/?@@ 	L 	LL  !46JKKK	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L##I/?@@ 	L 	LL  !57JKKK	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	Ls   !A		AA/!BB #B !C//C36C3!EE	E( FFF: G&&G*-G* H88H<?H< J

JJ0!KK!$K!!L11L58L5c                    t          |j                  }|j        }|                     |j        |           d|z  }d|z  } || } || }d}d}	|                     ||           |                     |                                |           |                     |                                |           |                     |                    |          |           |                     |                    |          |           |                     |                    ||	          |           |                     |                    ||	          |           |                     ||           |                     |                                |           |                     |                                |           |                     |                    |          |           |                     |                    |          |           |                     |                    ||	          |           |                     |                    ||	          |           d S )N)r   )r   rt   strict)rQ   _fields_encoded_counterpartassertIs_decoded_counterpartr1   rH  rx   )
r@   str_typenum_args
bytes_typestr_args
bytes_args
str_resultbytes_resultencodingerrorss
             rH   _check_result_typez#UrlParseTestCase._check_result_type  sI   x'((2
j5x@@@8#h&
Xx(
!z:.X...,,..999,,..
;;;,,X66AAA,,X66
CCC,,Xv>>III,,Xv>>
KKKz222**,,j999**,,l;;;**844jAAA**844lCCC**8V<<jIII**8V<<lKKKKKr   c                     t           j        j        t           j        j        t           j        j        g}|D ]}|                     |           d S r-   )r.   r/   DefragResultSplitResultParseResultr  )r@   result_typesresult_types      rH   test_result_pairsz"UrlParseTestCase.test_result_pairs  sU     ,
#
,
"
,
"

 ( 	1 	1K##K0000	1 	1r   c                 L   t           j                            dd          }|                     |ddgi           t           j                            dd          }|                     |ddgi           t           j                            dd          }|                     |dd	gi           t           j                            d
d          }|                     |ddgi           t           j                            d
dd          }|                     |ddgi           d S )N	   key=Ł%E9latin-1r  key   Łé   key=Ł%C3%A9rE  rt      Ł��
   key=Ł%E9-   Ł�-ignorer  r     Ł-)r.   r/   r_   r1   r@   rD   s     rH   test_parse_qs_encodingz'UrlParseTestCase.test_parse_qs_encoding  s-   &&&KK%,!8999&&'9G&LL%,!8999&&'9G&LL%*>)?!@AAA&&'7'&JJ%/):!;<<<&&'7'AI ' K K%)!566666r   c                 8   t           j                            dd          }|                     |dg           t           j                            dd          }|                     |dg           t           j                            dd          }|                     |dg           t           j                            d	d          }|                     |d
g           t           j                            d	dd          }|                     |dg           d S )Nr  r  r  )r  r  r  rE  rt   )r  r  r  )r  r  r  r  )r  r  )r.   r/   rV   r1   r  s     rH   test_parse_qsl_encodingz(UrlParseTestCase.test_parse_qsl_encoding  s   '')'LL"7!8999''(:W'MM"7!8999''(:W'MM"?!@AAA''(87'KK":!;<<<''(87AI ( K K"4!566666r   c                 J   |                      t                    5  t          j                            d                    dgdz            d           d d d            n# 1 swxY w Y   t          j                            d                    dgdz            d           d S )Nr   za=a   
   )max_num_fields)r  r  r.   r/   r_   joinr   s    rH   test_parse_qsl_max_num_fieldsz.UrlParseTestCase.test_parse_qsl_max_num_fields  s    z** 	K 	KL!!#((E72:"6"6r!JJJ	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	Kchhwrz222FFFFFs   9A  A$'A$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 ]\  }}|                      d|d|          5  t          j                            |d          }|                     ||d|z             t          j                            |d          }|                     ||d|z             d d d            n# 1 swxY w Y   d S )N;;;r"   r	   r   r$   r   r   r
   a=1;a=2r   r      ;   ;;r&   r   r   r(   r   r   r      a=1;a=2r   r!   
Original: , Expected: 	separatorrM   )rQ  r.   r/   r_   r1   )r@   parse_qs_semicolon_casesrW   rX   rD   result_bytess         rH   test_parse_qs_separatorz(UrlParseTestCase.test_parse_qs_separator  s   "I2JcC5\"5'889sCj)*2JBKtdVn%VHVH==>$t-.$
  5 	R 	RLD&I4IIvIIJJ R R..ts.CC  1Cd1JKKK%|44TT4JJ  v7ID7PQQQ	R R R R R R R R R R R R R R R	R 	Rs   A7C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 ]\  }}|                      d|d|          5  t          j                            |d          }|                     ||d|z             t          j                            |d          }|                     ||d|z             d d d            n# 1 swxY w Y   d S )Nr  r  r"   r
   r$   r   r   r  r   r   r  r  r&   r   r(   r   r   r  r   r    r  r  r  rM   )rQ  r.   r/   rV   r1   )r@   parse_qsl_semicolon_casesrW   rX   rD   r  s         rH   test_parse_qsl_separatorz)UrlParseTestCase.test_parse_qsl_separator  s   "I2Jj\"\<89Z012JBK|n%nn=>,56%
! 6 	R 	RLD&I4IIvIIJJ R R///DD  1Cd1JKKK%|55dd5KK  v7ID7PQQQ	R R R R R R R R R R R R R R R	R 	Rs   A7CC	C	c                 >   t           j                            ddgddd          }t          |                    d                    h dk    sJ  G d d	          }t           j                            d
 |            id          }|                     |d           d S )NrO   r~   )   r,     r
   Tr   >   a=1a=2b=3b=4b=5c                       e Zd Zd ZdS ):UrlParseTestCase.test_urlencode_sequences.<locals>.Trivialc                     dS )Ntrivialr   r   s    rH   __str__zBUrlParseTestCase.test_urlencode_sequences.<locals>.Trivial.__str__  s     yr   N)__name__
__module____qualname__r  r   r   rH   Trivialr    s#        ! ! ! ! !r   r  r	   z	a=trivial)r.   r/   rm  setrC   r1   )r@   rD   r  s      rH   test_urlencode_sequencesz)UrlParseTestCase.test_urlencode_sequences  s     ''q!f9(E(EtLL6<<$$%%)L)L)LLLLL	! 	! 	! 	! 	! 	! 	! 	! ''ggii(8$??-----r   c                    t           j                            ddi          }|                     |d           t           j                            ddit           j        j                  }|                     |d           t           j                            ddidt           j        j                  }|                     |d	           d S )
Nr	   z
some valueza=some+valuezsome value/another)	quote_viaza=some%20value%2Fanotherr   )safer  za=some%20value/another)r.   r/   rm  r1   quoter  s     rH   test_urlencode_quote_viaz)UrlParseTestCase.test_urlencode_quote_via  s    ''l(;<<000''.B(C28,2D ( F F!;<<<''.B(C-0FL<N ( P P!9:::::r   c                 0   |                      t          t          j        j        d           t          j                            d          }|                     |d           t          j                            d          }|                     |d           d S )Nr  s   archaeological arcanazarchaeological%20arcanar   r   )r  rl  r.   r/   quote_from_bytesr1   r  s     rH   test_quote_from_bytesz&UrlParseTestCase.test_quote_from_bytes&  s}    )V\%BEJJJ../GHH!:;;;..s33$$$$$r   c                     t           j                            d          }|                     |d           t           j                            d          }|                     |d           d S )Nz	abc%20defs   abc defr   r   )r.   r/   unquote_to_bytesr1   r  s     rH   test_unquote_to_bytesz&UrlParseTestCase.test_unquote_to_bytes-  s^    ..{;;,,,..r22%%%%%r   c                     |                      t          t          j        j        dd           |                      t          t          j        j        dd           d S )Ns   foorE  r  r  )r  )r  rl  r.   r/   r  r   s    rH   test_quote_errorsz"UrlParseTestCase.test_quote_errors3  sU    )V\%7#* 	 	, 	, 	,)V\%7QQQQQr   c                    t           j                            d          }|                     |j        d           |                     |j        d           t           j                            d          }|                     |j        d           |                     |j        d           t           j                            d          }|                     |j        d           |                     |j        d           t           j                            d          }|                     |j        d           |                     |j        d           d S )Nztel:+31-641044153telz+31-641044153ztel:+31641044153z+31641044153)r.   r/   r>   r1   r2   r4   r0   )r@   p1p2s      rH   test_issue14072z UrlParseTestCase.test_issue140728  s    \""#677E***/222\""#566E***.111\""#677E***/222\""#566E***.11111r   c                 b   |                      t          t          j        j        d           |                      t          t          j        j        d           |                      t          t          j        j        d           |                      t          t          j        j        d           |                      t          t          j        j        d           |                      t          t          j        j        d           |                      t          t          j        j        d           |                      t          t          j        j        d           |                      t          t          j        j        d	           |                      t          t          j        j        d
           d S )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)r  r  r.   r/   r>   r   s    rH   test_invalid_bracketed_hostsz-UrlParseTestCase.test_invalid_bracketed_hostsG  s@   *fl&;=efff*fl&;=lmmm*fl&;=bccc*fl&;=_```*fl&;=^___*fl&;=_```*fl&;=[\\\*fl&;=tuuu*fl&;  >J  	K  	K  	K*fl&;=Z[[[[[r   c                    t           j                            d          }|                     |j        d           |                     |j        d           |                     |j        d           t           j                            d          }|                     |j        d           |                     |j        d           |                     |j        d           t           j                            d          }|                     |j        d           |                     |j        d           |                     |j        d           d S )	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/   r>   r1   r<   r:   r4   )r@   r  r  p3s       rH   test_splitting_bracketed_hostsz/UrlParseTestCase.test_splitting_bracketed_hostsS  s$   \""#FGGh///f---'***\""#YZZ&ABBBf---'***\""#jkk&RSSSf---'*****r   c                 p   d}t           j                            d          }|                     t          |          5  |j         d d d            n# 1 swxY w Y   t           j                            d          }|                     t          |          5  |j         d d d            d S # 1 swxY w Y   d S )Nz3Port could not be cast to integer value as 'oracle'z%http://Server=sde; Service=sde:oracle)r.   r/   r0   r;  r  r=   r>   )r@   messager  r  s       rH   !test_port_casting_failure_messagez2UrlParseTestCase.test_port_casting_failure_messagea  s(   G\""#JKK##J88 	 	GG	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 \""#JKK##J88 	 	GG	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s#   AAAB++B/2B/c                    t           j                            d          }|                     |j        d           |                     |j        d           |                     |j        d           t           j                            d          }|                     |j        d           |                     |j        d           |                     |j        d           t           j                            d          }|                     |j        d           |                     |j        d	           |                     |j        d
           t           j                            d          }|                     |j        d           |                     |j        d           |                     |j        d           d S )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/   r0   r1   r2   r4   r5   )r@   r  s     rH   test_telurl_paramsz#UrlParseTestCase.test_telurl_paramsk  s   \""#GHHE***'***$>???\""#899E***"3444B'''\""#GHHE***&)))$?@@@\""#JKKE****---$>?????r   c                     t           j                            t           j        j                  }|                     dt          |                     d S )NQuoter)r.   r/   _Quoter_ALWAYS_SAFEassertInrepr)r@   quoters     rH   test_Quoter_reprz!UrlParseTestCase.test_Quoter_repr  s<    %%fl&?@@hV-----r   c                 B    t           j                                         d S r-   )r.   r/   clear_cacher   s    rH   "test_clear_cache_for_code_coveragez3UrlParseTestCase.test_clear_cache_for_code_coverage  s      """""r   c                     |                      t                    5  t          j        j        }ddd           dS # 1 swxY w Y   dS )z5Test that urllib.parse.__getattr__() fails correctly.N)r  AttributeErrorr.   r/   this_does_not_exist)r@   unuseds     rH   !test_urllib_parse_getattr_failurez2UrlParseTestCase.test_urllib_parse_getattr_failure  s    ~.. 	6 	6\5F	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6s   :>>c                 P   g }h d}t          t          j                  D ]`}|                    d          s||v rt	          t          j        |          }t	          |dd           dk    r|                    |           a|                     t          j        j        |           d S )N>   unwrapsplittagto_bytes	splitattr	splithost	splitport	splittype	splituser
ResultBase
splitnport
splitquery
splitvaluer  splitpasswdrA  r  zurllib.parse)dirr.   r/   
startswithr  appendassertCountEqual__all__)r@   r   undocumentednameobjects        rH   test_allzUrlParseTestCase.test_all  s    
 
 
 %% 	& 	&Ds## t|';';V\400Fv|T22nDD%%%fl2H=====r   c                    dd D             fdt          t          t          dt          j                            D             }|                     d|           |                     d|           t          j                            d           | 	                    t                    5  t          j                            d           d d d            n# 1 swxY w Y   d	D ]}d
D ]}|D ]}d                    ||                    |                    }|                     |d                    t          |                              5  | 	                    t                    5  t          j                            |           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   ̌ьd S )Nz/:#?@c                 R    h | ]$}d                      t          |                    %S ){:04X})formatord)rR   cs     rH   	<setcomp>z?UrlParseTestCase.test_urlsplit_normalization.<locals>.<setcomp>  s*    DDDX__SVV,,DDDr   c                     g | ]R}t          j        |          r<t          t          j        |                                                    z  r|vP|SS r   )unicodedatadecompositionr  rC   )rR   r)  	hex_charsillegal_charss     rH   rT   z@UrlParseTestCase.test_urlsplit_normalization.<locals>.<listcomp>  ss     
 
 
(++
 S!:1!=!=!C!C!E!EFFF
 &&  '&&r      u   ℀u   ＃u   http://プ:80u   http://プ︓80)r   r   r{  )znetloc{}false.netloczn{}user@netlocz{}://{}/pathr&  )rA   char)mapchrr@  sys
maxunicoder  r.   r/   r>   r  r  r'  rQ  r(  )r@   denorm_charsr2   r3   r)  rA   r.  r/  s         @@rH   test_urlsplit_normalizationz,UrlParseTestCase.test_urlsplit_normalization  s     DDmDDD	
 
 
 
 
3c3> : :;;
 
 
 	h---h--- 	6777z** 	A 	AL!!"?@@@	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A / 	7 	7FD 7 7% 7 7A(//a8H8HIIC#HOOCFF4K4KLL 7 7!..z:: 7 7"L11#6667 7 7 7 7 7 7 7 7 7 7 7 7 7 77 7 7 7 7 7 7 7 7 7 7 7 7 7 777	7 	7sH   0 CC #C F1	. FF1	FF1	!F"F1	1F58F5N)6r  r  r  rI   rZ   r`   r   r   r   r   r   r   r   r  r  r  r'  r)  r<  rB  rL  rS  rX  r[  r]  rf  rj  rn  rx  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   rH   r+   r+   G   sl       18 18 18f7 7 77 7 7!5 !5 !5F$= $= $=LJ J JS S S"A "A "A`@ @ @
%J %J %JZ7B 7B 7Br5& 5& 5&n0N 0N 0Nd4 4 4.M M M[ [ [z#t #t #tJ9D 9D 9Dv# # #&; ; ;$'* '* '*RU U U@ @ @&@ @ @$D D DV V V*@ @ @H H HBL L L0L L L21 1 17 7 77 7 7G G G
R R R*R R R*. . .; ; ;% % %& & &R R R
2 2 2
\ 
\ 
\+ + +  @ @ @*. . .# # #6 6 6
> > > 7 7 7 7 7r   r+   c                   Z    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dS )Utility_Testsz=Testcase to test the various utility functions in the urllib.c                 ^   t           j        j        }|                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d	          d
           d S )Nztype:opaquestring)r#  opaquestringr;  )Nr;  :opaquestring)Nr<  ztype:)r#  r   ztype:opaque:string)r#  zopaque:string)r.   r/   
_splittyper1   )r@   r  s     rH   test_splittypezUtility_Tests.test_splittype  s    L+	#6779QRRR>224JKKK?335LMMM7++\:::#788:STTTTTr   c                    t           j        j        }|                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d	          d
           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           d S )Nz%//www.example.org:80/foo/bar/baz.html)www.example.org:80/foo/bar/baz.htmlz//www.example.org:80)r@  r   rA  )NrA  z//127.0.0.1#@host.com)	127.0.0.1/#@host.comz//127.0.0.1#@host.com:80)rB  z/#@host.com:80z//127.0.0.1:80#@host.com)z127.0.0.1:80rC  z///file)r   z/filez//example.net/file;)example.netz/file;z//example.net/file?)rD  z/file?z//example.net/file#)rD  z/file#)r.   r/   
_splithostr1   )r@   r  s     rH   test_splithostzUtility_Tests.test_splithost  s   L+	#JKKD	F 	F 	F#9::3	5 	5 	5#6774	6 	6 	6 	#:;;5	7 	7 	7#=>>8	: 	: 	:#=>>8	: 	: 	: 	9--&	( 	( 	( 	#8992	4 	4 	4#8992	4 	4 	4#8992	4 	4 	4 	4 	4r   c                 ^   t           j        j        }|                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d	          d
           d S )Nr.  )	User:Passwww.python.org:080z@www.python.org:080)r   rI  rI  )NrI  z
User:Pass@)rH  r   r3  )zUser@example.com:PassrI  )r.   r/   
_splituserr1   )r@   r  s     rH   test_splituserzUtility_Tests.test_splituser  s    L+	#ABB<	> 	> 	>#8993	5 	5 	5#7885	7 	7 	7<00*	, 	, 	,#MNNH	J 	J 	J 	J 	Jr   c                 N   t           j        j        }|                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d	          d
           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           d S )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 2rM  z
user+1:a+b)zuser+1za+bzuser:)r  r   r  )r  Nz:ab)r   rM  )r.   r/   _splitpasswdr1   )r@   r  s     rH   test_splitpasswdzUtility_Tests.test_splitpasswd  s    l/Y//@@@[113CDDD[113CDDD[113CDDD[113CDDD[113CDDDZ00/BBBZ00/BBB[113CDDD\224EFFFW--|<<<V,,n===U++Z88888r   c                    t           j        j        }|                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d	           |                      |d
          d           |                      |d          d           |                      |d          d           d S )N	parrot:88)parrot88rR  rR  Nparrot:rB  )rB  Nparrot:cheese)rV  Nz[::1]:88)[::1]rS  rW  )rW  Nz:88)r   rS  )r.   r/   
_splitportr1   )r@   r  s     rH   test_splitportzUtility_Tests.test_splitport  s   L+	;//1ABBB8,,.>???9--/?@@@;//1DEEE?335LMMM:..@@@7++_===5)):66666r   c                    t           j        j        }|                      |d          d           |                      |d          d           |                      |dd          d           |                      |d          d           |                      |dd          d           |                      |d          d	           |                      |dd          d
           |                      |d          d           |                      |dd          d           |                      |d          d           d S )NrQ  )rR  rF  rR  )rR  7   )rR  r\  rU  rB  )rB  r[  )rB  r\  rV  rT  zparrot: +1_0 )r.   r/   _splitnportr1   )r@   r  s     rH   test_splitnportzUtility_Tests.test_splitnport  s_   \-
K00.AAAH--~>>>Hb11>BBBI..???Ir22NCCCK002CDDDK446GHHHO446FGGGOR88:JKKKO446FGGGGGr   c                     t           j        j        }|                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           d S )	Nhttp://python.org/fake?foo=bar)http://python.org/fakefoo=barzhttp://python.org/fake?foo=bar?)r`  r   ra  )ra  Nz?foo=bar)r   rb  )r.   r/   _splitqueryr1   )r@   r  s     rH   test_splitqueryzUtility_Tests.test_splitquery  s     \-
$DEE>	@ 	@ 	@$EFF?	A 	A 	A$<==9	; 	; 	;J//AAAAAr   c                 ^   t           j        j        }|                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d	          d
           d S )Nhttp://example.com?foo=bar#baz)http://example.com?foo=barbazzhttp://example.com?foo=bar#)rg  r   z#baz)r   rh  rg  )rg  Nz"http://example.com?foo=bar#baz#boo)rf  boo)r.   r/   	_splittagr1   )r@   r  s     rH   test_splittagzUtility_Tests.test_splittag&  s    <)"BCC>	@ 	@ 	@"?@@;	= 	= 	=&));777">??=	? 	? 	?"FGGB	D 	D 	D 	D 	Dr   c                 :   t           j        j        }|                      |d          dddgf           |                      |d          ddgf           |                      |d          dddgf           |                      |d          dg f           d S )Nz/path;attr1=value1;attr2=value2r  zattr1=value1zattr2=value2z/path;r   z;attr1=value1;attr2=value2)r.   r/   
_splitattrr1   )r@   r  s     rH   test_splitattrzUtility_Tests.test_splitattr2  s    L+	#DEE!NN#CD	F 	F 	F8,,wo>>>#?@@~~>?	A 	A 	A7++gr];;;;;r   c                 ^   t           j        j        }|                      |d          d           |                      |d          d           |                      |d          d           |                      |d          d           |                      |d	          d
           d S )Nrb  )r  barzfoo=)r  r   z=bar)r   rp  foobar)rq  Nzfoo=bar=baz)r  zbar=baz)r.   r/   _splitvaluer1   )r@   r  s     rH   test_splitvaluezUtility_Tests.test_splitvalue;  s     \-
I..???F++[999F++[999H--/?@@@M224FGGGGGr   c                     t           j                            d          }|                     |d           |                     t
          t           j        j        d           d S )Nzhttp://www.python.orgu   http://www.python.org/mediæval)r.   r/   	_to_bytesr1   r  UnicodeErrorr  s     rH   test_to_byteszUtility_Tests.test_to_bytesE  sb    ''(?@@!8999,(>?	A 	A 	A 	A 	Ar   c                 z    dD ]7}t           j                            |          }|                     |d           8d S )N)z<URL:scheme://host/path>z<scheme://host/path>zURL:scheme://host/pathscheme://host/pathry  )r.   r/   r  r1   )r@   wrapped_urlrA   s      rH   test_unwrapzUtility_Tests.test_unwrapK  sM    L 	8 	8K,%%k22CS"67777	8 	8r   N)r  r  r  __doc__r>  rF  rK  rO  rY  r^  rd  rk  rn  rs  rw  r{  r   r   rH   r9  r9    s        GGU U U4 4 4:J J J9 9 9$	7 	7 	7H H H
B 
B 
B
D 
D 
D< < <H H HA A A8 8 8 8 8r   r9  c                   V    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S )DeprecationTestc                 &   |                      t                    5 }t          j        j        }|                     |t          j        j                   d d d            n# 1 swxY w Y   |                     dt          |j	                             d S )NzQuoter will be removed)
assertWarnsDeprecationWarningr.   r/   r  r  r  r  strwarning)r@   cm	old_classs      rH   test_Quoter_deprecationz'DeprecationTest.test_Quoter_deprecationT  s    011 	;R+IMM)V\%9:::	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	.BJ@@@@@s   7AA"%A"c                     |                      t                    5 }t          j                            d           d d d            n# 1 swxY w Y   |                     t          |j                  d           d S )Nr   zUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r.   r/   r  r1   r  r  r@   r  s     rH   test_splittype_deprecationz*DeprecationTest.test_splittype_deprecationZ      011 	'RL""2&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	'RZ?	@ 	@ 	@ 	@ 	@    AAAc                     |                      t                    5 }t          j                            d           d d d            n# 1 swxY w Y   |                     t          |j                  d           d S )Nr   zUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r.   r/   r  r1   r  r  r  s     rH   test_splithost_deprecationz*DeprecationTest.test_splithost_deprecationa  r  r  c                     |                      t                    5 }t          j                            d           d d d            n# 1 swxY w Y   |                     t          |j                  d           d S )Nr   zUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r.   r/   r  r1   r  r  r  s     rH   test_splituser_deprecationz*DeprecationTest.test_splituser_deprecationh  r  r  c                     |                      t                    5 }t          j                            d           d d d            n# 1 swxY w Y   |                     t          |j                  d           d S )Nr   zWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r.   r/   r  r1   r  r  r  s     rH   test_splitpasswd_deprecationz,DeprecationTest.test_splitpasswd_deprecationo  s    011 	)RL$$R(((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	)RZ?	@ 	@ 	@ 	@ 	@r  c                     |                      t                    5 }t          j                            d           d d d            n# 1 swxY w Y   |                     t          |j                  d           d S )Nr   zUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r.   r/   r  r1   r  r  r  s     rH   test_splitport_deprecationz*DeprecationTest.test_splitport_deprecationv  r  r  c                     |                      t                    5 }t          j                            d           d d d            n# 1 swxY w Y   |                     t          |j                  d           d S )Nr   zVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r.   r/   r  r1   r  r  r  s     rH   test_splitnport_deprecationz+DeprecationTest.test_splitnport_deprecation}      011 	(RL##B'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(RZ?	@ 	@ 	@ 	@ 	@r  c                     |                      t                    5 }t          j                            d           d d d            n# 1 swxY w Y   |                     t          |j                  d           d S )Nr   zVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r.   r/   r  r1   r  r  r  s     rH   test_splitquery_deprecationz+DeprecationTest.test_splitquery_deprecation  r  r  c                     |                      t                    5 }t          j                            d           d d d            n# 1 swxY w Y   |                     t          |j                  d           d S )Nr   zTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r.   r/   r  r1   r  r  r  s     rH   test_splittag_deprecationz)DeprecationTest.test_splittag_deprecation  s    011 	&RL!!"%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&RZ?	@ 	@ 	@ 	@ 	@r  c                     |                      t                    5 }t          j                            d           d d d            n# 1 swxY w Y   |                     t          |j                  d           d S )Nr   zUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r  r  r.   r/   r  r1   r  r  r  s     rH   test_splitattr_deprecationz*DeprecationTest.test_splitattr_deprecation  r  r  c                     |                      t                    5 }t          j                            d           d d d            n# 1 swxY w Y   |                     t          |j                  d           d S )Nr   zWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() instead)r  r  r.   r/   r  r1   r  r  r  s     rH   test_splitvalue_deprecationz+DeprecationTest.test_splitvalue_deprecation  s    011 	(RL##B'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(RZ@	A 	A 	A 	A 	Ar  c                     |                      t                    5 }t          j                            d           d d d            n# 1 swxY w Y   |                     t          |j                  d           d S )Nr   z/urllib.parse.to_bytes() is deprecated as of 3.8)r  r  r.   r/   r  r1   r  r  r  s     rH   test_to_bytes_deprecationz)DeprecationTest.test_to_bytes_deprecation  s    011 	&RL!!"%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&RZJ	L 	L 	L 	L 	Lr  N)r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   rH   r~  r~  R  s        A A A@ @ @@ @ @@ @ @@ @ @@ @ @@ @ @@ @ @@ @ @@ @ @A A AL L L L Lr   r~  __main__)r4  r,  unittesturllib.parser.   r   r   r  r  rU   r^   TestCaser+   r9  r~  r  mainr   r   rH   <module>r     sO   



         %## H"I	2J8*	I;9+	I;j\\<01Z()"I	2J
BK	J<
[M	K=
[M|nnn56,-.k]'()}o*+,1 > H"I	2J2t*	B;3+	C";cC5\5'001sCj!""I	2J
BK	C#<
S4&M	D3%=
TC5MtdVnVHVH556$t%&dSE]S;-()utfod\?+,1 6q7 q7 q7 q7 q7x( q7 q7 q7f#U8 U8 U8 U8 U8H% U8 U8 U8pRL RL RL RL RLh' RL RL RLj zHMOOOOO r   