+
    Bi                    |   ^ RI t^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
Ht ^ RIHt ^ RIHt ^ RIt^ RIt ^ RIt^ RIt^ RIt^ RIt]P,                  '       g   ]	P.                  ! R4      hR tR%R lt ! R R	]4      t ! R
 R]	P8                  4      t ! R R]	P8                  4      t ! R R]	P8                  4      t ! R R]	P8                  ]4      t  ! R R]	P8                  4      t! ! R R]	P8                  4      t" ! R R]	P8                  ]4      t# ! R R]	P8                  4      t$ ! R R]	P8                  4      t% ! R R]	P8                  4      t& ! R R]	P8                  4      t' ! R  R!]	P8                  4      t( ! R" R#]	P8                  4      t)]*R$8X  d   ]	PV                  ! 4        R# R#   ] d    Rt EL~i ; i)&    N)support)	os_helper)socket_helperztest requires gethostname()c                     \        \        V 4      4      R ,          P                  4       p\        V4      ^8X  d
   RV,          pRV,           # ):   NNz0%s%)hexordupperlen)charhex_reprs   & '/usr/lib/python3.14/test/test_urllib.py	hexescaper      s=    3t9~b!'')H
8}8#>    c                    aaa  ! V3R  lR\         P                  4      o ! VV3R lR\        P                  P                  4      oV Sn        S# )c                   R   <a  ] tR t^&t o ^tV3R ltR tRR ltRR ltR t	Rt
V tR# )	fakehttp.<locals>.FakeSocketc                   < VSn         R # N)buf)selfdataFakeHTTPConnections   &&r   sendall$fakehttp.<locals>.FakeSocket.sendall)   s    %)"r   c                8    V ;P                   ^,          un         V # )   )io_refs)r   argskwdss   &*,r   makefile%fakehttp.<locals>.FakeSocket.makefile,   s    LLALKr   Nc                h    V P                   '       d   R # \        P                  P                  W4      # r   )closedioBytesIOread)r   amts   &&r   r)   !fakehttp.<locals>.FakeSocket.read0   s!    {{{::??4--r   c                h    V P                   '       d   R # \        P                  P                  W4      # r%   )r&   r'   r(   readline)r   lengths   &&r   r-   %fakehttp.<locals>.FakeSocket.readline5   s#    {{{::&&t44r   c                    V ;P                   ^,          un         V P                   ^ 8X  d"   \        P                  P                  V 4       R# R# )r   N)r   r'   r(   closer   s   &r   r1   "fakehttp.<locals>.FakeSocket.close:   s3    LLAL||q 

  & !r    r   )__name__
__module____qualname____firstlineno__r   r   r"   r)   r-   r1   __static_attributes____classdictcell__)__classdict__r   s   @r   
FakeSocketr   &   s(     	*		.
	5
	' 	'r   r<   c                   V   <a  ] tR t^?t o RtV3R lt Z'       d
   R tRtV tR# RtV tR# )$fakehttp.<locals>.FakeHTTPConnectionNc                j   < S! V P                   4      V n        V P                  \        V 4      n        R # r   )fakedatasocktypefakesock)r   r<   s   &r   connect,fakehttp.<locals>.FakeHTTPConnection.connectD   s#    "4==1DI"&))DJr   c                    R # r   r4   r2   s   &r   r1   *fakehttp.<locals>.FakeHTTPConnection.closeM   s    r   )rA   )	r5   r6   r7   r8   r   rD   r1   r9   r:   )r;   r<   
mock_closes   @r   r   r>   ?   s'      	, :
  r   r   )r'   r(   httpclientHTTPConnectionr@   )r@   rH   r   r<   s   &f@@r   fakehttprL   %   s?    'RZZ '2 T[[77   #+r   c                   0   a  ] tR t^Tt o RR ltR tRtV tR# )FakeHTTPMixinc                    \        WR 7      p\        P                  P                  V n        V\        P                  n        R# )rH   N)rL   rI   rJ   rK   _connection_class)r   r@   rH   fake_http_classs   &&& r   rL   FakeHTTPMixin.fakehttpU   s*    "8C!%!;!;%4"r   c                D    V P                   \        P                  n        R # r   )rQ   rI   rJ   rK   r2   s   &r   
unfakehttpFakeHTTPMixin.unfakehttpZ   s    %)%;%;"r   )rQ   NF)r5   r6   r7   r8   rL   rU   r9   r:   r;   s   @r   rN   rN   T   s     5
< <r   rN   c                      a  ] tR t^^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tRtV tR# )urlopen_FileTestsc                ,   \        R V P                  P                  ,          R4      V n        \	        \
        P                  R4      p VP                  V P                  4       VP                  4        \
        P                  V n	        \        P                  P                  \        P                  ! V P                  4      4      V n        \        P                   P#                  RV P                  ,          4      V n        R#   TP                  4        i ; i)ztest_urllib: %s
asciiwbfile:%sN)bytes	__class__r5   textopenr   TESTFNwriter1   pathnameurllibparsequoteosfsencodequoted_pathnamerequesturlopenreturned_obj)r   fs   & r   setUpurlopen_FileTests.setUpf   s    -0G0GG!#	!!4(	GGDIIGGI!((%||11"++dmm2LM"NN229t?S?S3ST GGIs   D Dc                    V P                   P                  4        \        P                  ! \        P
                  4       R # r   )rn   r1   ri   remover   rc   r2   s   &r   tearDownurlopen_FileTests.tearDowns   s&    !
		)""#r   c                P    R F  pV P                  V P                  V4       K!  	  R# )r)   N)	r)   r-   	readlinesfilenor1   infogeturlgetcode__iter__)assertHasAttrrn   r   attrs   & r   test_interface urlopen_FileTests.test_interfacex   s&    GDt00$7Gr   c                n    V P                  V P                  V P                  P                  4       4       R # r   )assertEqualra   rn   r)   r2   s   &r   	test_readurlopen_FileTests.test_read~   s%    D$5$5$:$:$<=r   c                    V P                  V P                  V P                  P                  4       4       V P                  R V P                  P                  4       R4       R# )r   zKcalling readline() after exhausting the file did not return an empty stringN)r   ra   rn   r-   r2   s   &r   test_readlineurlopen_FileTests.test_readline   sK    D$5$5$>$>$@Ad//88:3	4r   c                    V P                   P                  4       pV P                  \        V4      ^R4       V P                  V^ ,          V P                  R4       R# )r   z.readlines() returned the wrong number of linesz"readlines() returned improper textN)rn   rw   r   r   ra   )r   
lines_lists   & r   test_readlines urlopen_FileTests.test_readlines   sM    &&002
Z!I	KA		=	?r   c                    V P                   P                  4       pV P                  V\        R 4       V P	                  \
        P                  ! V\        V P                  4      4      V P                  R4       R# )zfileno() did not return an intzTReading on the file descriptor returned by fileno() did not return the expected textN)	rn   rx   assertIsInstanceintr   ri   r)   r   ra   )r   file_nums   & r   test_filenourlopen_FileTests.test_fileno   sW    $$++-h-MN3tyy>:DII<	=r   c                :    V P                   P                  4        R # r   )rn   r1   r2   s   &r   
test_closeurlopen_FileTests.test_close   s     	!r   c                    V P                  V P                  P                  \        P                  P
                  4       R # r   )r   rn   headersemailmessageMessager2   s   &r   test_headersurlopen_FileTests.test_headers   s(    d//779N9NOr   c                t    V P                  V P                  P                  R V P                  ,           4       R# file:N)r   rn   urlrk   r2   s   &r   test_urlurlopen_FileTests.test_url   s)    **..$:N:N0NOr   c                P    V P                  V P                  P                  4       R # r   )assertIsNonern   statusr2   s   &r   test_statusurlopen_FileTests.test_status   s    $++223r   c                    V P                  V P                  P                  4       \        P                  P
                  4       R # r   )r   rn   ry   r   r   r   r2   s   &r   	test_infourlopen_FileTests.test_info   s+    d//4468M8MNr   c                |    V P                  V P                  P                  4       R V P                  ,           4       R# r   )r   rn   rz   rk   r2   s   &r   test_geturlurlopen_FileTests.test_geturl   s,    **113Wt?S?S5STr   c                X    V P                  V P                  P                  4       4       R # r   )r   rn   r{   r2   s   &r   test_getcodeurlopen_FileTests.test_getcode   s    $++3356r   c                b    V P                    F  pV P                  WP                  4       K   	  R # r   )rn   r   ra   )r   lines   & r   	test_iterurlopen_FileTests.test_iter   s&     %%DT99- &r   c                    V P                  \        \        P                  P                  R V P
                  ,           4       R# )z./N)assertRaises
ValueErrorrf   rl   rm   re   r2   s   &r   test_relativelocalfile(urlopen_FileTests.test_relativelocalfile   s'    *V^^%;%;D4==<PQr   c                   R pV P                  \        P                  P                  4      ;_uu_ 4       p\        P                  P                  V4       RRR4       \        P                  R8X  d)   V P                  XP                  P                  R4       R# V P                  XP                  P                  R4       R#   + '       g   i     Lu; i)zfile://pythontest.net/foo/barNntz\\pythontest.net\foo\barz-file:// scheme is supported only on localhost)r   rf   errorURLErrorrl   rm   ri   namer   	exceptionfilenamereason)r   r   es   &  r   test_remote_authority'urlopen_FileTests.test_remote_authority   s    -v||4455NN""3' 677d?Q[[113NOQ[[//1`a 65s    CC	)re   rk   rn   ra   N)r5   r6   r7   r8   rp   rt   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r9   r:   rX   s   @r   rZ   rZ   ^   sg     U$
8>4?="
PP4OU7.Rb br   rZ   c                   D   a  ] tR t^t o R tR tR tR tR tR t	Rt
V tR# )	
ProxyTestsc                    V P                  \        P                  ! 4       4      V n        \	        \
        P                  4       F5  pR VP                  4       9   g   K  V P                  P                  V4       K7  	  R# )proxyN)	enterContextr   EnvironmentVarGuardenvlistri   environlowerunset)r   ks   & r   rp   ProxyTests.setUp   sN    $$Y%B%B%DEbjj!A!'')#q! "r   c                   V P                   P                  R R4       \        P                  P	                  4       pV P                  RVR,          4       V P                   P                  R R4       V P                  \        P                  P                  R4      4       V P                  \        P                  P                  R4      4       V P                  \        P                  P                  R4      4       R# )NO_PROXY	localhostno0localhost, anotherdomain.com, newdomain.com:1234anotherdomain.comanotherdomain.com:8888newdomain.com:1234N)r   setrf   rl   getproxies_environmentr   
assertTrueproxy_bypass_environmentr   proxiess   & r   +test_getproxies_environment_keep_no_proxies6ProxyTests.test_getproxies_environment_keep_no_proxies   s    Z-..779gdm4Z!ST??@STU??@XYZ??@TUVr   c                (    V P                   P                  R R4       \        P                  P	                  4       pV P                  RVR,          4       V P                   P                  RR4       \        P                  P	                  4       pV P                  RV4       V P                   P                  R4       V P                   P                  R 4       R#   T P                   P                  R4       T P                   P                  R 4       i ; i)
HTTP_PROXYhttp://somewhere:3128rI   REQUEST_METHODGETN)r   r   rf   rl   r   r   assertNotInr   r   s   & r   test_proxy_cgi_ignore ProxyTests.test_proxy_cgi_ignore   s    		)HHLL'>?nn;;=G4gfoFHHLL)51nn;;=GVW-HHNN+,HHNN<( HHNN+,HHNN<(s   BC 8Dc                   \         P                  P                  pV P                  P	                  R R4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R	4      4       V P                  V! R
4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       R# )r   z8localhost, anotherdomain.com, newdomain.com:1234, .d.o.tr   	LocalHost	LOCALHOSTz
.localhostr   z.newdomain.com:1234z	foo.d.o.tzd.o.tr   z.anotherdomain.com:8888zwww.newdomain.com:1234prelocalhostnewdomain.comznewdomain.com:1235Nrf   rl   r   r   r   r   assertFalser   bypasss   & r   (test_proxy_bypass_environment_host_match3ProxyTests.test_proxy_bypass_environment_host_match   s    88ZO	Q{+,{+,{+,|,-345456{+,w(78989:789/001 456r   c                   \         P                  P                  pV P                  P	                  R R4       V P                  V! R4      4       V P                  V! R4      4       V P                  P	                  R R4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       R# )r   *r   r   z*, anotherdomain.comr   Nr   r   s   & r   *test_proxy_bypass_environment_always_match5ProxyTests.test_proxy_bypass_environment_always_match   s    88Z%/0345Z!7823401 456r   c                    \         P                  P                  pV P                  P	                  R R4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       R# )r   r   z
localhost
zanotherdomain.com:8888
znewdomain.com:1234
N)rf   rl   r   r   r   r   r   s   & r   %test_proxy_bypass_environment_newline0ProxyTests.test_proxy_bypass_environment_newline  sb    88ZG	I./ :;< 678r   )r   N)r5   r6   r7   r8   rp   r   r   r   r   r   r9   r:   rX   s   @r   r   r      s)     "	W
)7&79 9r   r   c                   2   a  ] tR tRt o R tR tR tRtV tR# )ProxyTests_withOrderedEnvi
  c                l    \         P                  V n        \        P                  ! 4       \         n        R # r   )ri   r   
_saved_envcollectionsOrderedDictr2   s   &r   rp   ProxyTests_withOrderedEnv.setUp  s    ** ,,.
r   c                0    V P                   \        n        R # r   )r   ri   r   r2   s   &r   rt   "ProxyTests_withOrderedEnv.tearDown  s    __
r   c                   R \         P                  R&   R\         P                  R&   V P                  \        P                  P                  R4      4       V P                  \        P                  P                  R4      4       R \         P                  R&   R\         P                  R&   \        P                  P                  4       pV P                  / V4       R\         P                  R&   R	\         P                  R&   V P                  \        P                  P                  R4      4       V P                  \        P                  P                  R
4      4       V P                  \        P                  P                  R4      4       V P                  \        P                  P                  R4      4       V P                  \        P                  P                  R4      4       R\         P                  R&   R\         P                  R&   \        P                  P                  4       pV P                  RVR,          4       R# ) no_proxyr   No_Proxy	arbitrary
http_proxyr   r   z%localhost, noproxy.com, my.proxy:1234zxyz.comznoproxy.com:5678zmy.proxy:1234zmy.proxyzhttp://somewhereelse:3128
Http_ProxyrI   N)	ri   r   r   rf   rl   r   r   r   r   r   s   & r   ,test_getproxies_environment_prefer_lowercaseFProxyTests_withOrderedEnv.test_getproxies_environment_prefer_lowercase  s   !#

:!,

:@@MN@@MN#%

< #:

< ..779W%!H

:!*

:??LM??@RST??PQ@@LM@@MN#:

< #>

< ..7790'&/Br   )r   N)	r5   r6   r7   r8   rp   rt   r  r9   r:   rX   s   @r   r   r   
  s     /%C Cr   r   c                   <  a  ] tR tRt o R tR tR t]P                  ! ]	R4      R 4       t
]P                  ! ]	R4      R 4       t]P                  ! ]	R4      R 4       t]P                  ! ]	R4      R	 4       tR
 tR tR tR tR tR tR tR tR tR tR tRtV tR# )urlopen_HttpTestsi.  c                   V P                  R V,           R,           4        \        P                  P                  R4      pV P	                  VP                  4       R4       V P	                  VP                  4       R4       V P	                  VP                  4       R4       V P	                  VP                  4       ^4       V P                  4        R#   T P                  4        i ; i)s   HTTP/s    200 OK

Hello!http://python.org/s   Hello!r   N)	rL   rf   rl   rm   r   r-   rz   r{   rU   )r   verfps   && r   
check_readurlopen_HttpTests.check_read1  s    hn'??@	''(<=BR[[]I6R[[]C0RYY[*>?RZZ\3/OODOOs   BC C$c                    R pV P                  R4        \        P                  P                  V4      pV P	                  VP                  4       V4       V P                  4        R#   T P                  4        i ; i)z-http://docs.python.org/library/urllib.html#OK   HTTP/1.1 200 OK

Hello!N)rL   rf   rl   rm   r   rz   rU   )r   r   r  s   &  r   test_url_fragment#urlopen_HttpTests.test_url_fragment<  sX    =67	'',BRYY[#.OODOOs   ?A& &A8c                    V P                  R 4        \        P                  P                  R4      pV P	                  VP
                  4       V P                  4        R#   T P                  4        i ; i)r  http://www.python.orgN)rL   rf   rl   rm   r   
will_closerU   )r   resps   & r   test_willclose urlopen_HttpTests.test_willcloseF  sN    67	>>))*ABDOODOO,OODOOs   :A A1zssl module requiredc                   \        \        ^ ^!4      4      ^.,            F  p\        V4      pRV R2pV P                  R4        \	        V4      P                  RR4      p\        P                  P                  pV P                  VRV 24      ;_uu_ 4        \        P                  P                  RV 24       RRR4       V P                  VRV 24      ;_uu_ 4        \        P                  P                  R	V 24       RRR4       V P                  4        K  	  R#   + '       g   i     Ln; i  + '       g   i     L9; i  T P                  4        i ; i)
r   z//localhost:7777/test/   HTTP/1.1 200 OK

Hello.\\\contain control.*http:Nhttps:r   rangechrrL   reprreplacerI   rJ   
InvalidURLassertRaisesRegexrf   rl   rm   rU   r   char_nor   schemeless_urlescaped_char_reprr-  s   &     r   (test_url_path_with_control_char_rejected:urlopen_HttpTests.test_url_path_with_control_char_rejectedN  s/   E!TN+tf44Gw<D4TF!<NMM:;" %)J$6$6tU$C!![[33
++"34E3F GI INN**U>2B+CDI ++"34E3F GI INN**VN3C+DEI !) 5I II I !=   AE#D9%E#D2ED/*E2E=EEc                ,   V P                  R 4       RpRV,           R,           p \        P                  P                  pV P	                  VR4      ;_uu_ 4        \
        P                  P                  RV 24       RRR4       V P	                  VR4      ;_uu_ 4        \
        P                  P                  RV 24       RRR4       V P                  4        R#   + '       g   i     Lg; i  + '       g   i     L5; i  T P                  4        i ; i)	r"  z:localhost:7777?a=1 HTTP/1.1
X-injected: header
TEST: 123//:8080/test/?test=az*contain control.*\\r.*(found at least . .)r&  Ncontain control.*\\nr'  	rL   rI   rJ   r-  r.  rf   rl   rm   rU   r   hostr1  r-  s   &   r   4test_url_path_with_newline_header_injection_rejectedFurlopen_HttpTests.test_url_path_with_newline_header_injection_rejectedf  s    67O';;	 //J''IK K&&~.>'?@K ''
4KLL&&/?'@A M OOK K ML OO;   4D #C<"D #C.D C+	&D .C>	9D Dc                   \        \        ^ ^!4      4      ^.,            F  p\        V4      pRV R2pV P                  R4        \	        V4      P                  RR4      p\        P                  P                  pV P                  VRV 24      ;_uu_ 4        \        P                  P                  RV 24       RRR4       V P                  VRV 24      ;_uu_ 4        \        P                  P                  R	V 24       RRR4       V P                  4        K  	  R#   + '       g   i     Ln; i  + '       g   i     L9; i  T P                  4        i ; i)
r   z//localhostz/test/r"  r#  r$  r%  r&  Nr'  r(  r/  s   &     r   (test_url_host_with_control_char_rejected:urlopen_HttpTests.test_url_host_with_control_char_rejected{  s#   E!TN+tf44Gw<D*4&7NMM:;	"$(J$6$6tU$C!![[33
++"34E3F GI INN**U>2B+CDI ++J:KL]K^8_``NN**VN3C+DE a ! 5I I a` !r5  c                ,   V P                  R 4       RpRV,           R,           p \        P                  P                  pV P	                  VR4      ;_uu_ 4        \
        P                  P                  RV 24       RRR4       V P	                  VR4      ;_uu_ 4        \
        P                  P                  RV 24       RRR4       V P                  4        R#   + '       g   i     Lg; i  + '       g   i     L5; i  T P                  4        i ; i)	r"  zlocalhost
X-injected: header
r7  r8  zcontain control.*\\rr&  Nr9  r'  r:  r;  s   &   r   4test_url_host_with_newline_header_injection_rejectedFurlopen_HttpTests.test_url_host_with_newline_header_injection_rejected  s    674';;	//J''35 5&&~.>'?@5 ''
4KLL&&/?'@A M OO5 5 ML OOr?  c                (    V P                  R 4       R# )s   0.9Nr  r2   s   &r   test_read_0_9urlopen_HttpTests.test_read_0_9  s     	r   c                (    V P                  R 4       R# )s   1.0NrG  r2   s   &r   test_read_1_0urlopen_HttpTests.test_read_1_0      r   c                (    V P                  R 4       R# )s   1.1NrG  r2   s   &r   test_read_1_1urlopen_HttpTests.test_read_1_1  rM  r   c                   V P                  R RR7        V P                  \        P                  P                  4      ;_uu_ 4       p\        P
                  P                  R4       RRR4       XP                  P                  4        V P                  4        R#   + '       g   i     L<; i  T P                  4        i ; i)s   HTTP/1.1 401 Authentication Required
Date: Wed, 02 Jan 2008 03:03:54 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) mod_ssl/2.8.22 OpenSSL/0.9.7e
Connection: close
Content-Type: text/html; charset=iso-8859-1
TrP   r  N)
rL   r   rf   r   	HTTPErrorrl   rm   r   r1   rU   )r   cms   & r   test_read_bogus!urlopen_HttpTests.test_read_bogus  s     
  	 		""6<<#9#9::b&&';< ;LL OO	 ;: OOs#   1B-  B&"B- B*	%B- -B?c                   V P                  R RR7        RpV P                  \        P                  P                  V4      ;_uu_ 4       p\        P
                  P                  R4       RRR4       XP                  P                  4        V P                  4        R#   + '       g   i     L<; i  T P                  4        i ; i)s   HTTP/1.1 302 Found
Date: Wed, 02 Jan 2008 03:03:54 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) mod_ssl/2.8.22 OpenSSL/0.9.7e
Location: file://guidocomputer.athome.com:/python/license
Connection: close
Content-Type: text/html; charset=iso-8859-1
TrP   zRedirection to url 'file:r  N)
rL   r.  rf   r   rR  rl   rm   r   r1   rU   )r   msgrS  s   &  r   test_invalid_redirect'urlopen_HttpTests.test_invalid_redirect  s       	 		-C''(>(>DD&&';< ELL OO	 ED OOs#   4B0 	 B)"B0 B-	(B0 0Cc                   \        \        P                  P                  P                  4       F  pV P                  R RR7        V P                  \        P                  P                  4      ;_uu_ 4       p\        P                  P                  R4       RRR4       XP                  P                  4        V P                  4        K  	  R#   + '       g   i     L@; i  T P                  4        i ; i)s_   HTTP/1.1 302 Found
Location: file://guidocomputer.athome.com:/python/license
Connection: close
TrP   http://somethingN)r)  rf   rl   HTTPRedirectHandlermax_redirectionsrL   r   r   rR  rm   r   r1   rU   )r   irS  s   &  r   test_redirect_limit_independent1urlopen_HttpTests.test_redirect_limit_independent  s     v~~99JJKAMM    "&&v||'='=>>"NN**+=> ?""$! L ?> !s$   1C!6 C"C!CC!!C3c                    V P                  R 4        V P                  \        \        P                  P
                  R4       V P                  4        R#   T P                  4        i ; i)r   r[  N)rL   r   OSErrorrf   rl   rm   rU   r2   s   &r   test_empty_socket#urlopen_HttpTests.test_empty_socket  sG     	c	gv~~'='=?QROODOOs   /A A&c                r   V P                  \        P                  P                  4      ;_uu_ 4       p\        P                  P                  R 4       RRR4       V P                  XP                  P                  4       V P                  VP                  P                  4       R#   + '       g   i     L\; i)z/file://localhost/a/file/which/doesnot/exists.pyN)
r   rf   r   r   rl   rm   r   r   r   r   r   r   s   & r   test_missing_localfile(urlopen_HttpTests.test_missing_localfile  sl    v||4455NN""#TU 6,,-**+ 65    B&&B6	c                "   \         P                  ! 4       w  r\        P                  P	                  VR R7      p\        P
                  P                  V4      pVP                  RR7      P                  4       p V P                  \        P                  P                  V4      4       \        P                  P                  V4      ;_uu_ 4       pV P                  V4       V P                  VP                  V4       RRR4       \        P                   ! V4       \        P"                  ! V4       V P%                  \        P                  P                  V4      4       V P'                  \        P(                  P*                  4      ;_uu_ 4        \        P                  P                  V4       RRR4       R#   + '       g   i     L; i  \        P                   ! T4       \        P"                  ! T4       i ; i  + '       g   i     R# ; i)T
add_schemer   )netlocN)tempfilemkstemprf   rl   pathname2urlrg   urlsplit_replacerz   r   ri   pathexistsrm   r   r   r1   unlinkr   r   r   r   )r   fdtmp_filetmp_file_canon_urlparsedtmp_fileurlfobjs   &      r   test_file_notexists%urlopen_HttpTests.test_file_notexists  sK   '')#^^88d8S&&'9:oo[o9@@B	 OOBGGNN845''44%  +=> 5 HHRLIIh12v||4455NN"";/ 65 54 HHRLIIh555s1   9AG .F9<G  G=9G		G .G:=H	c                v   R pV P                  \        P                  P                  4      ;_uu_ 4       p\        P                  P                  V4       RRR4       V P                  XP                  P                  4       V P                  VP                  P                  4       R#   + '       g   i     L\; i)zftp:///pathNr   rf   r   r   rl   rm   r   r   r   r   r   )r   test_ftp_urlr   s   &  r   test_ftp_nohost!urlopen_HttpTests.test_ftp_nohost  sr    $v||4455NN""<0 6--.**+ 65s    B((B8	c                r   V P                  \        P                  P                  4      ;_uu_ 4       p\        P                  P                  R 4       RRR4       V P                  XP                  P                  4       V P                  VP                  P                  4       R#   + '       g   i     L\; i)z.ftp://localhost/a/file/which/doesnot/exists.pyNr  rf  s   & r   test_ftp_nonexisting&urlopen_HttpTests.test_ftp_nonexisting  sn    v||4455NN""#ST 6--.**+ 65ri  r4   N)r5   r6   r7   r8   r  r  r  unittest
skipUnlesssslr3  r=  rA  rD  rH  rK  rO  rT  rX  r_  rc  rg  r|  r  r  r9   r:   rX   s   @r   r  r  .  s     	 34" 5". 34 5( 34" 5"  34 5 
  "",0",, ,r   r  c                   V   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tRtV tR# )urlopen_DataTestsi  c                   V P                  \        P                  P                  4       R V n        RV n        RV n        RV n        RV n        V P                  \        P                  P                  V P                  4      4      V n        V P                  \        P                  P                  V P                  4      4      V n        V P                  \        P                  P                  V P                  4      4      V n        R# )u   test data URLs :;,%=& ö Ä sU   PNG

   IHDR         {@   sRGB    IDATc```? 
o/    IENDB`zZdata:text/plain;charset=UTF-8,test%20data%20URLs%20%3A%3B%2C%25%3D%26%20%C3%B6%20%C3%84%20zPdata:text/plain;charset=ISO-8859-1;base64,dGVzdCBkYXRhIFVSTHMgOjssJT0mIPYgxCA%3Dzdata:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAIAAAB7
QOjdAAAAAXNSR0IArs4c6QAAAA9JREFUCNdj%0AYGBg%2BP//PwAGAQL%2BCm8 vHgAAAABJRU5ErkJggg%3D%3D%0A%20N)
addCleanuprf   rl   
urlcleanupra   imagetext_urltext_url_base64	image_urlr   rm   text_url_resptext_url_base64_respimage_url_respr2   s   &r   rp   urlopen_DataTests.setUp  s    112 ;	F 	
( 	 	. 	
 "..NN""4==13$($5$5NN""4#7#78%:!"//0F0Ft~~0VWr   c                P    R F  pV P                  V P                  V4       K!  	  R# )r)   N)r)   r-   rw   r1   ry   rz   r{   r|   )r}   r  r~   s   & r   r    urlopen_DataTests.test_interface'  s&    GDt1148Gr   c                V   V P                  V P                  P                  4       \        P                  P
                  4       V P                  V P                  P                  4       P                  4       RR.4       V P                  V P                  P                  4       R,          \        \        V P                  4      4      4       \        P                  P                  R4      pV P                  VP                  4       P                  4       RR.4       VP!                  4        R# )
text/plainzcontent-lengthzdata:,N)r  r  )charsetz
ISO-8859-1)r  zUS-ASCII)r   r  ry   r   r   r   r   r  
get_paramsr  strr   r  rf   rl   rm   r1   )r   rs   & r   r   urlopen_DataTests.test_info-  s    d005579N9NO22779DDF!:;	=,,1134DEDJJ 	"NN""8,,,.!89	;		r   c                >   V P                  V P                  P                  4       V P                  4       V P                  V P                  P                  4       V P
                  4       V P                  V P                  P                  4       V P                  4       R # r   )r   r  rz   r  r  r  r  r  r2   s   &r   r   urlopen_DataTests.test_geturl8  sp    ++224dmmD2299;  	",,335t~~Fr   c                    V P                  V P                  P                  4       P                  \	        V P                  P                  4       P                  4       4      R ,          4      V P                  4       R# r  N)r   r  r)   decodedictry   r  ra   r2   s   &r   test_read_text urlopen_DataTests.test_read_text>  sZ    ++00299##((*5578CEFJii	Qr   c                    V P                  V P                  P                  4       P                  \	        V P                  P                  4       P                  4       4      R ,          4      V P                  4       R# r  )r   r  r)   r  r  ry   r  ra   r2   s   &r   test_read_text_base64'urlopen_DataTests.test_read_text_base64B  sY    22779@@**//1<<>?	JLII	r   c                n    V P                  V P                  P                  4       V P                  4       R # r   )r   r  r)   r  r2   s   &r   test_read_image!urlopen_DataTests.test_read_imageG  s%    ,,113TZZ@r   c                d    V P                  \        \        P                  P                  R 4       R# )zdata:text/plainNr   r   rf   rl   rm   r2   s   &r   test_missing_comma$urlopen_DataTests.test_missing_commaJ  s    *V^^%;%;<MNr   c                d    V P                  \        \        P                  P                  R 4       R# )zdata:;base64,Cg=Nr  r2   s   &r   test_invalid_base64_data*urlopen_DataTests.test_invalid_base64_dataM  s    *V^^%;%;<NOr   )r  r  r  ra   r  r  r  r  N)r5   r6   r7   r8   rp   r   r   r   r  r  r  r  r  r9   r:   rX   s   @r   r  r    s?     X@9	GQ
AOP Pr   r  c                   f   a  ] tR tRt o R tR tR tRR ltR tR t	R t
R	 tR
 tR tR tRtV tR# )urlretrieve_FileTestsiR  c                   V P                  \        P                  P                  4       . V n        V P                  \        P                  4       R V n         \        \        P                  R4      pVP                  V P                  4       VP                  4        VP                  4        R#     R# ; i  XP                  4        i     i ; i; i)s   testing urllib.urlretriever]   N)r  rf   rl   r  	tempFilesregisterFileForCleanUpr   rc   ra   rb   rd   r1   )r   FILEs   & r   rp   urlretrieve_FileTests.setUpU  s    112  	##I$4$451			(($/DJJtyy!JJLD Ds1   AB7 B/ /B47C8C	C	CCc                h    V P                    F  p\        P                  ! V4       K  	  R #     K$  ; ir   )r  ri   rs   )r   eachs   & r   rt   urlretrieve_FileTests.tearDownm  s"    NND4 #Ds   ,1c                    \         P                  P                  V4      p\        P                  P                  VR R7      # )Trk  )ri   rs  abspathrf   rl   rp  )r   filePaths   &&r   constructLocalFileUrl+urlretrieve_FileTests.constructLocalFileUrls  s.    77??8,~~**8*EEr   c                0   \         P                  ! 4       w  r# V P                  V4       \        P                  ! VR 4      pVP                  V4       VP                  4        VP                  4        V#     T# ; i  XP                  4        i     i ; i; i)r]   )rn  ro  r  ri   fdopenrd   r1   )r   r   newFdnewFilePathnewFiles   &&   r   createNewTempFile'urlretrieve_FileTests.createNewTempFilew  s}    
 &--/	''4iit,GMM$MMO D Ds0   A	A< "A4 4A9<B=BBBBc                <    V P                   P                  V4       R # r   )r  append)r   fileNames   &&r   r  ,urlretrieve_FileTests.registerFileForCleanUp  s    h'r   c                    \         P                  P                  R \        P                  ,          4      pV P                  V^ ,          \        P                  4       V P                  V^,          \        P                  P                  R4       R# )r^   zFdid not get an email.message.Message instance as second returned valueN)
rf   rl   urlretriever   rc   r   r   r   r   r   )r   results   & r   
test_basic urlretrieve_FileTests.test_basic  sb     ++I	8H8H,HII$4$45fQi)>)>9	:r   c                V   R \         P                  ,          pV P                  V4       \        P                  P                  V P                  \         P                  4      V4      pV P                  W^ ,          4       V P                  \        P                  P                  V4      R4       \        VR4      p VP                  4       pVP                  4        VP                  4        T P                  T P                  T4       R#     L"; i  TP                  4        i     i ; i; i)%s.2zcopy of the file was not maderbN)r   rc   r  rf   rl   r  r  r   r   ri   rs  rt  rb   r)   r1   ra   )r   second_tempr  r  ra   s   &    r   	test_copyurlretrieve_FileTests.test_copy  s    y///##K0++D,F,F-*,Qi0{3 69 	:K&	99;DJJLD) D Ds0   : D D DD(D! D(!D%#D(c                   a  ^ .3V 3R llpR\         P                  ,          pS P                  V4       \        P                  P                  S P                  \         P                  4      W!4       R# )r   c                    < SP                  V \        4       SP                  V\        4       SP                  V\        4       SP                  W^ ,          4       V^ ,          ^,           V^ &   R# )r   N)r   r   r   )block_countblock_read_size	file_sizecount_holderr   s   &&&&r   
hooktester9urlretrieve_FileTests.test_reporthook.<locals>.hooktester  sW    !!+s3!!/37!!)S1[q/:*1o1LOr   r  N)r   rc   r  rf   rl   r  r  )r   r  r  s   f  r   test_reporthook%urlretrieve_FileTests.test_reporthook  sV    NOS 	2 y///##K0""&&y'7'78	%r   c                (   . pV3R  lpV P                  4       p\        P                  P                  V P	                  V4      \
        P                  V4       V P                  \        V4      ^4       V P                  V^ ,          ^,          ^ 4       R# )c                 ,    VP                  WV34       R # r   r  r  r  r  _reports   &&&&r   r  Aurlretrieve_FileTests.test_reporthook_0_bytes.<locals>.hooktester      NNK)DEr   N	r  rf   rl   r  r  r   rc   r   r   r   reportr  srcFileNames   &   r   test_reporthook_0_bytes-urlretrieve_FileTests.test_reporthook_0_bytes  st    HN 	F,,.""4#=#=k#Jj	*Va(1q)r   c                j   . pV3R  lpV P                  R4      p\        P                  P                  V P	                  V4      \
        P                  V4       V P                  \        V4      ^4       V P                  V^ ,          ^,          ^4       V P                  V^,          ^,          ^4       R# )c                 ,    VP                  WV34       R # r   r  r  s   &&&&r   r  Aurlretrieve_FileTests.test_reporthook_5_bytes.<locals>.hooktester  r  r   Ns   xxxxxr  r  s   &   r   test_reporthook_5_bytes-urlretrieve_FileTests.test_reporthook_5_bytes  s     HN 	F,,X6""4#=#=k#Jj	*Va(1q)1q)r   c                   . pV3R  lpV P                  RR,          4      p\        P                  P                  V P	                  V4      \
        P                  V4       V P                  \        V4      ^4       V P                  V^ ,          ^,          R4       V P                  V^ ,          ^,          R4       V P                  V^,          ^,          R4       V P                  V^,          ^,          R4       R# )c                 ,    VP                  WV34       R # r   r  r  s   &&&&r   r  Durlretrieve_FileTests.test_reporthook_8193_bytes.<locals>.hooktester  r  r      xi   i    Nr  r  s   &   r   test_reporthook_8193_bytes0urlretrieve_FileTests.test_reporthook_8193_bytes  s     HN 	F,,TD[9""4#=#=k#Jj	*Va(1t,1t,1t,1t,r   )r  ra   Nr%   )r5   r6   r7   r8   rp   rt   r  r  r  r  r  r  r  r  r  r9   r:   rX   s   @r   r  r  R  sB     0F (:*$%	**- -r   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )urlretrieve_HttpTestsi  c                   V P                  \        P                  P                  4       V P	                  R 4       R pV P                  \        P                  P                  4      ;_uu_ 4         \        P                  P                  \        P                  VR7       V P                  4         RRR4       R#   T P                  4        i ; i  + '       g   i     R# ; i)   HTTP/1.1 200 OK
Date: Wed, 02 Jan 2008 03:03:54 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) mod_ssl/2.8.22 OpenSSL/0.9.7e
Connection: close
Content-Length: 100
Content-Type: text/html; charset=iso-8859-1

FF
c                     R # r   r4   )par1par2par3s   &&&r   _reporthookYurlretrieve_HttpTests.test_short_content_raises_ContentTooShortError.<locals>._reporthook  s    r   )
reporthookNr  rf   rl   r  rL   r   r   ContentTooShortErrorr  r   TEST_HTTP_URLrU   )r   r  s   & r   .test_short_content_raises_ContentTooShortErrorDurlretrieve_HttpTests.test_short_content_raises_ContentTooShortError  s    112  		 v||@@AA"**7+@+@6A + C ! BA
 ! BAAs$   /C1/B; C;CCC!	c                   V P                  \        P                  P                  4       V P	                  R 4       V P                  \        P                  P                  4      ;_uu_ 4         \        P                  P                  \        P                  4       V P                  4         RRR4       R#   T P                  4        i ; i  + '       g   i     R# ; i)r  Nr  r2   s   &r   Atest_short_content_raises_ContentTooShortError_without_reporthookWurlretrieve_HttpTests.test_short_content_raises_ContentTooShortError_without_reporthook  s    112  	 v||@@AA"**7+@+@A!	 BA !	 BAAs$   ,C.-B6C6CCC	r4   N)r5   r6   r7   r8   r	  r  r9   r:   rX   s   @r   r  r    s     "." "r   r  c                   V   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tRtV tR# )QuotingTestsi
  c                   R P                  . RO4      p\        P                  P                  V4      pV P	                  WRV: RV: 24       \        P                  P                  V4      pV P	                  WRV: RV: 24       R# )r  using quote():  != using quote_plus(): N)ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
0123456789z_.-~)joinrf   rg   rh   r   
quote_plus)r   do_not_quoter  s   &  r   test_never_quoteQuotingTests.test_never_quote$  su    xx !) * ##L1v6BFK	M((6v:FO	Qr   c                |    V P                  \        P                  P                  P                  ^ ,          R4       R# )r   r!  N)r   rf   rg   rh   __defaults__r2   s   &r   test_default_safeQuotingTests.test_default_safe1  s'    ++88;SAr   c                   R p\         P                  P                  WR7      pV P                  WRV: RV: 24       \         P                  P	                  VVR7      pV P                  WRV: RV: 24       \         P                  P                  VRR7      pV P                  WRV: RV: 24       \         P                  P                  RRRR	7      p\         P                  P                  RRR
R	7      pV P                  W2RV: RV: 24       \         P                  P                  RRRR	7      p\         P                  P                  RRR
R	7      pV P                  W2RV: RV: 24       R# )z<>safer  r  r  s   <>u   aüblatin-1   ü)encodingr"  r     N)rf   rg   rh   r   r  )r   quote_by_defaultr  expects   &   r   	test_safeQuotingTests.test_safe5  sY   ##$4#L)66FO	Q(()9.> ) @)6*F4	5 ##$45#A)66FO	Q ##Hyv#N##Hyr#J &*	+ ##Hyw#O##Hyr#J &*	+r   c                   \        ^ 4       Uu. uF  p\        V4      NK  	  ppVP                  R4       VP                  \        ^4      4       RP                  V4      pV F  p\        P
                  P                  V4      pV P                  \        V4      VRV: R\        V4      : RV: 24       \        P
                  P                  V4      pV P                  \        V4      VRV: R\        V4      : RV: 24       K  	  ?RpR	p\        P
                  P                  V4      pV P                  WdRV: R
V: 24       \        P
                  P                  V4      pV P                  WdRV: R
V: 24       R# u upi )    z<>#%"{}|\^[]`r  r  z should be escaped to z, not r  z should be escapes to zab[]cdz
ab%5B%5Dcdr  N)
r)  r*  r  r  rf   rg   rh   r   r   r  )r   numshould_quoter   r  partial_quoteexpecteds   &      r   test_default_quoting!QuotingTests.test_default_quotingR  sE    -2"I6ISCI6,-CH%ww|, D\\''-FYt_f #IdOV=> \\,,T2FYt_f #IdOV=> !  ##M266>G	I((76;CVL	N- 7s   Fc           
     R   \         P                  P                  R 4      pV P                  V\	        R 4      RV: R\	        R 4      : 24       \         P                  P                  R 4      pV P                  VRRV,          4       RpVP                  R \	        R 4      4      p\         P                  P                  V4      pV P                  W1RV: RV: 24       VP                  R R4      p\         P                  P                  V4      pV P                  W1RV: RV: 24       R# ) r  r  +zusing quote_plus(): %r != +z
a b cd e fr  N)rf   rg   rh   r   r   r  r,  )r   r  givenr(  s   &   r   test_quoting_spaceQuotingTests.test_quoting_spacen  s     ##C(36<inM	O((-6?	AsIcN3##E*6<fE	GsC(((/;A6J	Lr   c                   V P                  \        P                  P                  R 4      R4       V P                  \        P                  P                  R R4      R4       V P                  \        P                  P                  R4      R4       V P                  \        P                  P                  R R4      R4       R# )zalpha+beta gammazalpha%2Bbeta+gammar5  zalpha+beta+gammas   alpha+beta gamma   +N)r   rf   rg   r  r2   s   &r   test_quoting_plusQuotingTests.test_quoting_plus  s    001CD-	/001CSI+	- 	001DE-	/ 	001CTJ+	-r   c                T   R pRp\         P                  P                  V4      pV P                  W#RV: RV: 24       V P	                  \
        \         P                  P                  VRR7       \         P                  P                  V4      pV P                  W#RV: RV: 24       R# )   ab%A2%D8ab%FFr  r  r#  r%  zusing quote_from_bytes(): N)rf   rg   rh   r   r   	TypeErrorquote_from_bytesr   r6  r(  r  s   &   r   test_quote_bytesQuotingTests.test_quote_bytes  s    !##E*6<fE	G 	)V\\%7%7%. 	 	0 ..u5"F,	-r   c                V   R pRp\         P                  P                  V4      pV P                  W#RV: RV: 24       \         P                  P                  VRRR7      pV P                  W#RV: RV: 24       R pRp\         P                  P                  VRR7      pV P                  W#RV: RV: 24       R	pR
p\         P                  P                  V4      pV P                  W#RV: RV: 24       R	pV P	                  \
        \         P                  P                  VRR7       R	pRp\         P                  P                  VRRR7      pV P                  W#RV: RV: 24       R	pRp\         P                  P                  VRRR7      pV P                  W#RV: RV: 24       R# )u   ¢Øabÿz%C2%A2%C3%98ab%C3%BFr  r  Nr%  errorsr?  r#  r@     漢字%E6%BC%A2%E5%AD%97z%3F%3Fr,  z%26%2328450%3B%26%2323383%3Bxmlcharrefreplace)rf   rg   rh   r   r   UnicodeEncodeErrorrC  s   &   r   test_quote_with_unicode$QuotingTests.test_quote_with_unicode  s    '##E*6<fE	G ##ED#F6<fE	G !##EI#>6<fE	G %##E*6<fE	G ,fll.@.@%-6 	 	8 ##EI+4 $ 66<fE	G /##EI+> $ @6<fE	Gr   c                   R pRp\         P                  P                  VRR7      pV P                  W#RV: RV: 24       RpRp\         P                  P                  VRRR	7      pV P                  W#RV: RV: 24       R
# )u   ¢Ø ÿz
%A2%D8+%FFr#  r@  r  r  u   ab漢字 cdzab%3F%3F+cdr,  rG  N)rf   rg   r  r   rC  s   &   r   test_quote_plus_with_unicode)QuotingTests.test_quote_plus_with_unicode  s    (((C;A6J	L $((09 ) ;;A6J	Lr   r4   N)r5   r6   r7   r8   r  r  r)  r1  r7  r;  rD  rM  rP  r9   r:   rX   s   @r   r  r  
  s?     4QB+:N8L&
-- (GTL Lr   r  c                   V   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tRtV tR# )UnquotingTestsi  c           	     &   . p\        ^4       F  p\        \        V4      4      p\        V4      p\        P                  P                  V4      pV P                  WERV: RV: 24       \        P                  P                  V4      pV P                  WERV: RV: 24       VP                  V4       K  	  RP                  V4      p?\        P                  P                  V4      pV P                  VP                  R4      ^RV,          4       R# )   using unquote(): r  using unquote_plus(): r  r   z/using unquote(): not all characters escaped: %sN)r)  r   r*  rf   rg   unquoter   unquote_plusr  r  count)r   escape_listr-  r6  r(  r  escape_strings   &      r   test_unquotingUnquotingTests.test_unquoting  s    :Cc#h'EXF\\))%0FVV<BFKM\\..u5FVV$f./ u%  ,%%m4c*A &'	(r   c                    V P                  \        \        3\        P                  P
                  R 4       V P                  \        \        3\        P                  P
                  R4       R # )Nr4   )r   rA  AttributeErrorrf   rg   rX  r2   s   &r   #test_unquote_rejects_none_and_tuple2UnquotingTests.test_unquote_rejects_none_and_tuple  sD    9n5v||7K7KTR9n5v||7K7KRPr   c                   R pTp\         P                  P                  V4      pV P                  W#RV: RV: 24       RpTp\         P                  P                  V4      pV P                  W#RV: RV: 24       RpTp\         P                  P                  V4      pV P                  W#RV: RV: 24       R p\	        VR4      p\         P                  P                  V4      pV P                  W#RV: RV: 24       Rp\	        VR4      p\         P                  P                  V4      pV P                  W#RV: RV: 24       Rp\	        VR4      p\         P                  P                  V4      pV P                  W#RV: RV: 24       V P                  \        \        3\         P                  P
                  R4       V P                  \        \        3\         P                  P
                  R4       R# )	z%xabrV  r  z%xr   r\   using unquote_to_bytes(): Nr4   )	rf   rg   rX  r   r_   unquote_to_bytesr   rA  r`  rC  s   &   r   test_unquoting_badpercent(UnquotingTests.test_unquoting_badpercent  s   %%e,"F*, 	-%%e,"F*, 	-%%e,"F*, 	- ug&..u5"F*, 	-ug&..u5"F*, 	-ug&..u5"F*, 	-9n5v||7T7TVZ[9n5v||7T7TVXYr   c                    R pRp\         P                  P                  V4      pV P                  W#RV: RV: 24       R# )z%Ab%eAs   rd  r  Nrf   rg   re  r   rC  s   &   r   test_unquoting_mixed_case(UnquotingTests.test_unquoting_mixed_case  s<    ..u5"F,	-r   c                   R \        R4      ,          pRp\        P                  P                  V4      pV P	                  W#RV: RV: 24       \        P                  P                  V4      pV P	                  W#RV: RV: 24       R# )zab%sdcabcdr  r  rW  N)r   rf   rg   rX  r   rY  rC  s   &   r   test_unquoting_parts#UnquotingTests.test_unquoting_parts$  su     )C.(%%e,6<fE	G**51=CVL	Nr   c                   R pTp\         P                  P                  V4      pV P                  W#RV: RV: 24       VP	                  RR4      p\         P                  P                  V4      pV P                  W#RV: RV: 24       R# )zare+there+spaces...rV  r  r5  r4  rW  N)rf   rg   rX  r   r,  rY  rC  s   &   r   test_unquoting_plus"UnquotingTests.test_unquoting_plus0  sz    %%%e,8>G	IsC(**51=CVL	Nr   c                   R pRp\         P                  P                  V4      pV P                  W#RV: RV: 24       \         P                  P                  R4      pRpV P                  W#RV: RV: 24       RpRp\         P                  P                  V4      pV P                  W#RV: RV: 24       RpRp\         P                  P                  V4      pV P                  W#RV: RV: 24       R	# )
"br%C3%BCckner_sapporo_20050930.docs   brückner_sapporo_20050930.docrd  r  	   漢%C3%BCs   漢üs   %A2%D8ab%FFr>  s	   %A2ab%FFNri  rC  s   &   r   test_unquote_to_bytes$UnquotingTests.test_unquote_to_bytes<  s    48..u5"F,	- ..~>("F,	- "..u5"F,	-
  "..u5"F,	-r   c                J   R pRp\         P                  P                  V4      pV P                  W#RV: RV: 24       \         P                  P                  VRRR7      pV P                  W#RV: RV: 24       \         P                  P                  RRR7      pRpV P                  W#RV: RV: 24       R	pR
p\         P                  P                  V4      pV P                  W#RV: RV: 24       RpRp\         P                  P                  V4      pV P                  W#RV: RV: 24       \         P                  P                  VRR7      pV P                  W#RV: RV: 24       RpRp\         P                  P                  VRR7      pV P                  W#RV: RV: 24       \         P                  P                  R4      pRpV P                  W#RV: RV: 24       \         P                  P                  RRR7      pRpV P                  W#RV: RV: 24       R# )ru  u   brückner_sapporo_20050930.docrV  r  NrG  zbr%FCckner_sapporo_20050930.docr#  r@  rJ  rI  z%F3%B1u   �r,  )rH  r  ignorerv  u   漢üu   漢%FCrf   rg   rX  r   rC  s   &   r   test_unquote_with_unicode(UnquotingTests.test_unquote_with_unicode[  s   45%%e,8>G	I %%ed4%H8>G	I %%&G/8 & :58>G	I %%%e,8>G	I %%e,8>G	I %%eI%>8>G	I %%eH%=8>G	I %%n58>G	I
 %%kI%F8>G	Ir   c                t   R pRp\         P                  P                  V4      pV P                  W#RV: RV: 24       RpRp\         P                  P                  V4      pV P                  W#RV: RV: 24       RpRp\         P                  P                  V4      pV P                  W#RV: RV: 24       R# )	s   blueberryjamblueberryjamrV  r  s   blåbærsyltetøyu   blåbærsyltetøys   bl%c3%a5b%c3%a6rsyltet%c3%b8ju   blåbærsyltetøjNr{  rC  s   &   r   test_unquoting_with_bytes_input.UnquotingTests.test_unquoting_with_bytes_input  s    %%e,8>G	I 70%%e,8>G	I 10%%e,8>G	Ir   r4   N)r5   r6   r7   r8   r]  ra  rf  rj  ro  rr  rw  r|  r  r9   r:   rX   s   @r   rS  rS    s@     (*Q"ZH-
N
N->8ItI Ir   rS  c                   h   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tRtV tR# )urlencode_Testsi  c                L   . R
Op\         P                  P                  V4      pV F!  pV P                  WTRV: RV: RV: 24       K#  	  V P	                  VP                  R4      ^RV: RVP                  R4      : 24       VP                  R4      pWF^,
          ,          pWF^,           ,          pT P                  VP                  4       ;'       d    VP                  4       RV: RV: 24       V P	                  \        V4      ^RV: R\        V4      : R^: 24       R	# )1st=1ztesting z: z not found in &z: expected 2 '&'s; got z%: '&' not located in proper place in z#: unexpected number of characters: r  N)r  z2nd=2z3rd=3)
rf   rg   	urlencodeassertInr   rZ  indexr   isdigitr   )	r   r6  	test_typeexpect_somewherer  r0  amp_locationon_amp_lefton_amp_rights	   &&&      r   help_inputtypeurlencode_Tests.help_inputtype  s     7''.(HMM(F#Xv78 ) 	c*A#V\\#%68	9 ||C(A-.Q./++-HH,2F2F2H)	* 	Vk $S[+?	@r   c                6    V P                  R RRRRR/R4       R# )1st12nd23rd3zusing dict as input typeNr  r2   s   &r   test_using_mapping"urlencode_Tests.test_using_mapping  s"    U3c5=6	8r   c                .    V P                  . ROR4       R# )r  z*using sequence of two-item tuples as inputN))r  r  )r  r  )r  r  r  r2   s   &r   test_using_sequence#urlencode_Tests.test_using_sequence  s    FH	Jr   c                   R R/p\        R 4      : R\        R4      : 2p\        P                  P                  V4      pV P	                  W#4       RR/pRp\        P                  P                  V4      pV P	                  W#4       R# )r  =zkey namezA bunch of pluseszkey+name=A+bunch+of+plusesN)r   rf   rg   r  r   rC  s   &   r   test_quotingurlencode_Tests.test_quoting  sq    S	%cNIcN;''.(/0-''.(r   c                   R . RO/pR\         P                  P                  \        . RO4      4      ,          p\         P                  P	                  V4      pV P                  W#4       \         P                  P	                  VR4      pVR ,           F  pRV,          pV P                  W#4       K  	  V P                  VP                  R4      ^RVP                  R4      ,          4       R# )sequencezsequence=%sTr  zExpected 2 '&'s, got %sN)r  r  r  )rf   rg   r  r  r  r   r  rZ  )r   r6  r(  r  values   &    r   
test_dosequrlencode_Tests.test_doseq  s    O,!8!8_9M!NN''.(''t4:&&E"U*FMM&) ' 	c*A2V\\#5FF	Hr   c                    V P                  R \        P                  P                  / 4      4       V P                  R \        P                  P                  . 4      4       R# )r  Nr   rf   rg   r  r2   s   &r   test_empty_sequence#urlencode_Tests.test_empty_sequence  s@    V\\33B78V\\33B78r   c                    V P                  R \        P                  P                  R^/4      4       V P                  R\        P                  P                  RR/4      4       R# )za=1aza=NoneNr  r2   s   &r   test_nonstring_values%urlencode_Tests.test_nonstring_values  sH     6 6Qx @A6<<#9#93+#FGr   c                j   V P                  R \        P                  P                  R^^./R4      4       V P                  R\        P                  P                  RRR./R4      4       \        P
                  ! RR.4      pV P                  R\        P                  P                  RV/R4      4       R# )za=1&a=2r  Tz
a=None&a=aNza=a&a=b)r  r   )br   )r   rf   rg   r  r   r  )r   r   s   & r   test_nonstring_seq_values)urlencode_Tests.test_nonstring_seq_values  s    FLL$:$:C!Q=$$OP//tSk0BDI	K&&(';<//dTB	Dr   c                H   R
pRp\         P                  P                  VRRR7      pV P                  W#4       R
pRp\         P                  P                  V4      pV P                  W#4       R
pRp\         P                  P                  VRR7      pV P                  W#4       R	# )    %3F=%3FASCIIr,  rG  %C2%A0=%C3%81%A0=%C1r#  r@  N)r     Árf   rg   r  r   rC  s   &   r   test_urlencode_encoding'urlencode_Tests.test_urlencode_encoding  s    '''	'R( ( ''.( (''	'B(r   c                   RpRp\         P                  P                  VRRRR7      pV P                  W#4       RpRp\         P                  P                  VRRRR7      pV P                  W#4       RpRp\         P                  P                  VR4      pV P                  W#4       RpR	p\         P                  P                  VR4      pV P                  W#4       RpR
p\         P                  P                  VRRR7      pV P                  W#4       RpRp\         P                  P                  VRRR7      pV P                  W#4       R# )r  r  Tr  r,  )doseqr%  rH  z%3F=1&%3F=%3FrG  r  z%C2%A0=42&%C2%A0=%C3%81r  r#  r@  z%A0=42&%A0=%C1Nr  ))r  )r   r  ))r  )*   r  r  rC  s   &   r   test_urlencode_encoding_doseq-urlencode_Tests.test_urlencode_encoding_doseq  s@   '''T18 ( L( - ''t18 ( L( ( ''t4(-*''t4( (''ti'H(-!''ti'H(r   c                :   RpRp\         P                  P                  V4      pV P                  W#4       \         P                  P                  VR4      pV P                  W#4       RpRp\         P                  P                  VR4      pV P                  W#4       R# )   $z%A0%24=%C1%24Tz%A0%24=42&%A0%24=%C1%24N)r     $))r  )r  r  r  rC  s   &   r   test_urlencode_bytes$urlencode_Tests.test_urlencode_bytes9  s    - ''.(''t4( 4*''t4(r   c                z   Rp\         P                  P                  VRR7      pRpV P                  W24       Rp\         P                  P                  VRRR7      pRpV P                  W24       RpRp\         P                  P                  VRRR7      pV P                  W24       Rp\         P                  P                  VRRR7      pRpV P                  W24       RpRp\         P                  P                  VRRRR	7      pRpRp\         P                  P                  VRRRR7      pV P                  W24       R
# )r  z:$r!  z	%A0$=%C1$T)r  r"  z%A0$=%C1$&%A0$=13&%A0$=42r#  )r"  r%  )r  r"  r%  Nr  ))r  )r     r  r  )r   r6  r  r(  s   &   r   &test_urlencode_encoding_safe_parameter6urlencode_Tests.test_urlencode_encoding_safe_parameterG  s?   
 .''D'9(-''T'E( 9,''t$'?( .''D1: ( <(-''T1: ( < 9,''t$1: ( <(r   r4   N)r5   r6   r7   r8   r  r  r  r  r  r  r  r  r  r  r  r  r9   r:   rX   s   @r   r  r    sM     @@8
J
	)H9HD)&#)J)&) &)r   r  c                   L  a  ] tR tRt o R tR tR tR t]P                  ! ]
P                  R8H  R4      R 4       t]P                  ! ]
P                  R8H  R	4      R
 4       t]P                  ! ]P                   R4      R 4       tR tR tR t]P                  ! ]P,                  R4      R 4       t]P                  ! ]
P                  R8H  R4      R 4       t]P                  ! ]
P                  R8H  R	4      R 4       t]P                  ! ]P                   R4      R 4       tRtV tR# )Pathname_Testsio  c                2   \         P                  P                  R RRR4      pRp\        P                  P                  V4      pV P                  W#RV: RV: 24       \        P                  P                  V4      pV P                  WRV: RV: 24       R# )	partsofr  rs  zparts/of/a/pathpathname2url() failed; r  zurl2pathame() failed; N)ri   rs  r  rf   rl   rp  r   url2pathname)r   expected_pathexpected_urlr  s   &   r   r  Pathname_Tests.test_basicr  s    WdC@(,,];v ,0	1 ,,\: -1	2r   c                0   \         P                  P                  R RR4      pR\        P                  P                  R4      ,          p\        P                  P                  V4      pV P                  W#RV: RV: 24       Tp\        P                  P                  V4      pV P                  W#RV: RV: 24       \         P                  P                  RR4      pR	\        P                  P                  R4      ,          p\        P                  P                  V4      pV P                  W#RV: RV: 24       R
p\         P                  P                  RR4      p\        P                  P                  V4      pV P                  W#RV: RV: 24       R# )needszquot=ingherezneeds/%s/herer  r  zurl2pathname() failed; z	make sureusing_quotez%s/using_quotezmake+sure/using_unquotez	make+sureusing_unquoteN)
ri   rs  r  rf   rg   rh   rl   rp  r   r  rC  s   &   r   r  Pathname_Tests.test_quoting  sD    Wj&9 6<<#5#5j#AA,,U3 &*	+ ,,V4 &*	+ [-8!FLL$6$6{$CC,,U3 &*	+ *k?;,,U3 &*	+r   c                   \         P                  P                  p\        P                  P
                  pV P                  V! R 4      R 4       V P                  V! V4      R4       V P                  V! R4      R4       V P                  V! RV R24      R4       V P                  V! V RV R24      R4       V P                  V! V RV R24      R4       R# )	r  ///r  b.cza/b.c///a/b.cb%#cz///a/b%25%23cN)rf   rl   rp  ri   rs  sepr   r   fnr  s   &  r   test_pathname2url Pathname_Tests.test_pathname2url  s    ^^((ggkkB$C%(C#&auCL)73se1SE-.
;se1SE./Ar   c           
     `   \         P                  P                  pRVR3RRV R2R3V RV R2R3V RV R2R3.pV FY  w  r4V P                  VR7      ;_uu_ 4        V P	                  \
        P                  P                  VR	R
7      V4       RRR4       K[  	  R#   + '       g   i     Kp  ; i)r  file:///r  r  z
file:a/b.czfile:///a/b.cr  zfile:///a/b%25%23c)rs  Trk  N)r  r   )r  zfile:a)ri   rs  r  subTestr   rf   rl   rp  )r   r  subtestsrs  r  s   &    r   test_pathname2url_add_scheme+Pathname_Tests.test_pathname2url_add_scheme  s    ggkk*S\<(uAcU#0uAcU$!56
 #+D4((  NN///FV )( #+(((s   2BB-win32z#test specific to Windows pathnames.c                   \         P                  P                  pV P                  V! R 4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R	4       V P                  V! R
4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R 4       V P                  V! R!4      R"4       V P                  V! R#4      R$4       V P                  V! R%4      R4       V P                  V! R"4      R"4       V P                  V! R&4      R4       V P                  V! R'4      R4       . R)OpV F8  pV P                  V! \         P                  P	                  V4      4      V4       K:  	  R(# )*z
\\?\C:\dirz	///C:/dirz\\?\unc\server\share\dirz//server/share/dirC:///C:C:\///C:/zc:\a\b.cz///c:/a/b.czC:\a\b.cz///C:/a/b.cz	C:\a\b.c\z///C:/a/b.c/z	C:\a\\b.cz///C:/a//b.cz	C:\a\b%#cz///C:/a/b%25%23cu   C:\a\béz///C:/a/b%C3%A9C:\foo\bar\spam.foo///C:/foo/bar/spam.fooz
C:\foo:barz///C:/foo%3Abarzfoo:barz	foo%3Abarz\folder\test\///folder/test/z\\folder\test\z//folder/test/z\\\folder\test\z\\some\share\z//some/share/z\\some\share\a\b.cz//some/share/a/b.cu   \\some\share\a\b%#céz//some/share/a/b%25%23c%C3%A9zC:/a/b.cz
//?/C:/dirz//?/unc/server/share/dirN)r  r  r  )rf   rl   rp  r   r  )r   r  urlsr   s   &   r   test_pathname2url_win$Pathname_Tests.test_pathname2url_win  s@    ^^((,-{;<=?STD7+FX.L)=9L)=9N+^<N+^<M*,>?N+->?457OPM*,=>I4./1BC013CD235FG/0/B568LM:;=\]J7013GHL);7679MN* CR ; ;C @A3G r   z test specific to POSIX pathnamesc                    \         P                  P                  pV P                  V! R 4      R4       V P                  V! R4      R4       V P                  V! R4      R4       R# )z//a/b.cz	////a/b.cr  z
/////a/b.cz//////a/b.cN)rf   rl   rp  r   r   r  s   & r   test_pathname2url_posix&Pathname_Tests.test_pathname2url_posix  sO     ^^((I4J6K-8r   zneed os_helper.FS_NONASCIIc                2   \         P                  ! 4       p\         P                  ! 4       p\        P                  P                  \        P                  WR 7      pV P                  \        P                  P                  \        P                  4      V4       R# rG  N)sysgetfilesystemencodinggetfilesystemencodeerrorsrf   rg   rh   r   FS_NONASCIIr   rl   rp  r   r%  rH  r   s   &   r   test_pathname2url_nonascii)Pathname_Tests.test_pathname2url_nonascii  sb    ,,...0ll  !6!6 Y44Y5J5JKSQr   c                   \         P                  P                  p\        P                  P
                  pV P                  V! R 4      R 4       V P                  V! R4      V 4       V P                  V! R4      V 4       V P                  V! R4      V V 24       V P                  V! R4      R4       V P                  V! R4      RV R24       V P                  V! R4      V RV R24       V P                  V! R4      V RV R24       V P                  V! R	4      V RV R24       V P                  V! R
4      V V RV R24       V P                  V! R4      R4       V P                  V! R4      RV V R24       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       R# )r  r!  r  z////foozfoo/barbar/foo/barz//localhost/foo/barz
///foo/barz////foo/bar	data:blahzdata://blahdata:blahzfoo?barzfoo#barzfoo?bar=bazzfoo?bar#bazz	foo%3Fbarz	foo%23barzfoo%3Fbar%3Dbazzfoo%3Fbar%23bazN)rf   rl   r  ri   rs  r  r   r  s   &  r   test_url2pathname Pathname_Tests.test_url2pathname  s   ^^((ggkkB$CSE+Ese-FuSE]3EE*I#cU#7JC5C5)<=12se3se34GHL)cU#cU#+>?M*seC5C5,DEK+6M*eC5T,BCI.I.M*E2M*E2K)4K)4-.>-.>r   c                   \         P                  P                  pRRRRV 3RV 3RV V 23RRRV R23RV RV R23RV RV R23R	V RV R23R
V V RV R23RRRV V R23.pV FY  w  r4V P                  VR7      ;_uu_ 4        V P	                  \
        P                  P                  VRR7      V4       RRR4       K[  	  R#   + '       g   i     Kp  ; i)r   zfile:/r  z	file:////r  zfile:foo/barr	  zfile:/foo/barzfile://localhost/foo/barzfile:///foo/barzfile:////foo/barzfile:data://blahr  r  r   Trequire_schemeN)r   r  )zFILE:r  )zFiLe:r  )zfile:foor  )zfile:data:blahr  )ri   rs  r  r  r   rf   rl   r  )r   r  r  r   r  s   &    r    test_url2pathname_require_scheme/Pathname_Tests.test_url2pathname_require_scheme  s    ggkk# C5"SE#-(s3%s^,SS12'C5C5)<=3%s3%s 34C5SS!9:+5cU$!78
  #+C#&&  NN//D/I!# '& #+&&&s   2CCc           
        . ROpV Fk  pV P                  VR7      ;_uu_ 4        V P                  \        P                  P                  \        P
                  P                  VRR7       RRR4       Km  	  R#   + '       g   i     K  ; i)r  r  Tr  N)r  :r  zhttp:foozlocalfile:foozdata:foozdata:file:foozdata:file://foo)r  r   rf   r   r   rl   r  )r   r  r   s   &  r   'test_url2pathname_require_scheme_errors6Pathname_Tests.test_url2pathname_require_scheme_errors  sj    	
 C#&&!!LL))NN// " . '& &&&s   AA88B	zAFixed by https://github.com/emscripten-core/emscripten/pull/24593c                   \         P                  P                  p\        P                  P
                  pV P                  V! R RR7      V RV R24       V P                  V! R\        P                  ! 4        R24      V RV R24       V P                  V! R\        P                  ! 4        R2RR7      V RV R24       R# )//127.0.0.1/foo/barT)resolve_hostr  r	  r7  r
  N)	rf   rl   r  ri   rs  r  r   socketgethostnamer  s   &  r   test_url2pathname_resolve_host-Pathname_Tests.test_url2pathname_resolve_host,  s    ^^((ggkk1E#cRUQVVYGZ[b!3!3!5 6h?@SESEQTBUVb!3!3!5 6h?dSX[W\\_`c_ddgUhir   c                   \         P                  P                  pV P                  V! R 4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R	4      R4       V P                  V! R
4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R 4      R!4       V P                  V! R"4      R#4       V P                  V! R$4      R%4       V P                  V! R&4      R'4       V P                  V! R(4      R'4       V P                  V! R)4      R'4       V P                  V! R*4      R+4       V P                  V! R,4      R4       V P                  V! R-4      R4       V P                  V! R.4      R/4       V P                  V! R04      R'4       V P                  V! R14      R24       V P                  V! R34      R44       . R6OpV F8  pV P                  V! \         P                  P	                  V4      4      V4       K:  	  R5# )7z/C:/r  z//C:r  z//C:/z//C:\z//C:80/zC:80\z///C|r  r  z/C|//zC:\\z
///C|/pathzC:\pathz
///C/test/z\C\test\z////C/test/z	\\C\test\zc:/path/to/filezc:\path\to\filezC:/path/to/filezC:\path\to\filezC:/path/to/file/zC:\path\to\file\zC:/path/to//filezC:\path\to\\filezC|/path/to/filez/C|/path/to/filez///C|/path/to/filez///C|/foo/bar/spam.foor  u   ///è|/u   è:\z//host/share/spam.txt:eggsz\\host\share\spam.txt:eggsz///c:/spam.txt:eggszc:\spam.txt:eggsz//server/path/to/filez\\server\path\to\filez////server/path/to/filez/////server/path/to/filez//127.0.0.1/path/to/filez\\127.0.0.1\path\to\filez//localhost/C:/path/to/filez//localhost/C|/path/to/filez//localhost/path/to/filez\path\to\filez //localhost//server/path/to/filezC:/foo%2fbarz
C:\foo/barz//server/share/foo%2fbarz\\server\share\foo/barN)r  z	\C\test\\r  )rf   rl   r  r   rp  )r   r  pathsrs  s   &   r   test_url2pathname_win$Pathname_Tests.test_url2pathname_win4  s    ^^((FV,FT*Gf-Hv.I1Gd+Gd+Hv.Gh/L):6L)=9M*O<-.0DE-.0DE./1GH./1GH-.0DE./1EF013GH457OPM*K889;[\124GH346RS568TU679UV679XY9:<PQ9:<PQ679KL>?A]^N+];679UV) DR ; ;D ABDI r   c                >   \         P                  P                  pV P                  \         P                  P
                  VR 4       V P                  \         P                  P
                  VR4       V P                  \         P                  P
                  VR4       V P                  \         P                  P
                  VR4       V P                  \         P                  P
                  VR4       V P                  \         P                  P
                  VR4       R# )z	//foo/barz//localhost:/foo/barz//:80/foo/barz//:/foo/barz//c:80/foo/barr  N)rf   rl   r  r   r   r   r  s   & r   test_url2pathname_posix&Pathname_Tests.test_url2pathname_posixf  s     ^^((&,,//[A&,,//5KL&,,//_E&,,//]C&,,//5EF&,,//5JKr   c                   \         P                  ! 4       p\         P                  ! 4       p\        P                  pV P                  \        P                  P                  V4      \        P                  4       \        P                  P                  W1VR 7      pV P                  \        P                  P                  V4      \        P                  4       R# r  )r   r  r  r   r  r   rf   rl   r  rg   rh   r  s   &   r   test_url2pathname_nonascii)Pathname_Tests.test_url2pathname_nonasciiq  s    ,,...0##44S99;P;PQll   G44S99;P;PQr   r4   N)r5   r6   r7   r8   r  r  r  r  r  r  r   platformr  skipIfr  r   r  r  r  r  r  r   is_emscriptenr  r#  r&  r)  r9   r:   rX   s   @r   r  r  o  se    2+6	BV 0>@"H@"HH __S\\W,79999 ..0LMR NR?2#0.$ __W**,opj qj 0>@.J@.J` __S\\W,79L9L ..0LMR NRr   r  c                   &   a  ] tR tRt o R tRtV tR# )Utility_Testsiz  c                j    V P                  \        P                  P                  4       \        4       R # r   )r   rf   rl   thishosttupler2   s   &r   test_thishostUtility_Tests.test_thishost}  s    fnn557?r   r4   N)r5   r6   r7   r8   r3  r9   r:   rX   s   @r   r/  r/  z  s     @ @r   r/  c                   ,   a  ] tR tRt o R tR tRtV tR# )RequestTestsi  c                    \         P                  P                  pV! R 4      pV P                  VP	                  4       R4       V! R / 4      pV P                  VP	                  4       R4       R# )r  r   POSTN)rf   rl   Requestr   
get_methodr   r9  rl   s   &  r   test_default_values RequestTests.test_default_values  s[    ..((12++-u5126++-v6r   c                   \         P                  P                  pV! R RR7      pV P                  VP                  R4       V P                  VP                  4       R4       V! R / RR7      pV P                  VP                  R4       V P                  VP                  4       R4       V! R RR7      pV P                  VP                  4       R4       RVn        V P                  VP                  4       R4       R# )r  HEAD)methodr   N)rf   rl   r9  r   r@  r:  r;  s   &  r   test_with_method_arg!RequestTests.test_with_method_arg  s    ..((1&A0++-v612fE0++-v61%@++-u5++-v6r   r4   N)r5   r6   r7   r8   r<  rA  r9   r:   rX   s   @r   r6  r6    s     77 7r   r6  __main__rW   ),urllib.parserf   urllib.requesturllib.errorhttp.clientrI   email.messager   r'   r  testr   test.supportr   r   ri   r  r  ImportErrorr   rn  r   has_gethostnameSkipTestr   rL   objectrN   TestCaserZ   r   r   r  r  r  r  r  rS  r  r  r/  r6  r5   mainr4   r   r   <module>rQ     s        	   " & 	     $$$


9
::,^<F <bb)) bbJD9"" D9N!C 1 1 !CHS,))= S,lKP)) KP\H-H-- H-V*"H--} *"ZJL8$$ JLZRIX&& RIjA)h'' A)FIRX&& IRV@H%% @78$$ 70 zMMO S4  
Cs   F. .	F;:F;