+
    hG"                         ^ RI t^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RI	t
^ RIt ! R R4      t ! R R4      t ! R R4      t]P                   P#                  ^4      R	 4       tR# )
    N)cleandocc                   n   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V tR# )TestPackageIndexc                    R pVR,          pRP                  4       P                  ! R/ \        4       B p\        P                  P
                  P                  V4      '       g   Q hR# )z&http://other_url?:action=show_md5&amp;z'digest=0123456789abcdef0123456789abcdefz
            <a href="http://some_url">Name</a>
            (<a title="MD5 hash"
            href="{hash_url}">md5</a>)
        N )lstripformatlocals
setuptoolspackage_indexPYPI_MD5match)selfhash_urldocs   &  D/usr/lib/python3/dist-packages/setuptools/tests/test_packageindex.py
test_regexTestPackageIndex.test_regex   sa    ;== FHVV	 ( %h	(
 ''0066s;;;;    c                l   \         P                  P                  4       pR p\        P                  ! \
        \        P                  ! V4      R7      ;_uu_ 4        VP                  V4      p\        V\        P                  P                  4      '       g   Q h RRR4       R#   + '       g   i     R# ; i)z.http://127.0.0.1:0/nonesuch/test_package_indexr   Nr   r   PackageIndexpytestraises	Exceptionreescapeopen_url
isinstanceurlliberror	HTTPErrorr   indexurlvs   &   r   test_bad_url_bad_port&TestPackageIndex.test_bad_url_bad_port   sn    ((557>]]9BIIcN;;s#Aa!7!78888 <;;;s   >B""B3	c                p   \         P                  P                  RR7      pRp\        P                  ! \
        \        P                  ! V4      R7      ;_uu_ 4        VP                  V4      p\        V\        P                  P                  4      '       g   Q h RRR4       R#   + '       g   i     R# ; i)www.example.comhostszMurl:%20https://svn.plone.org/svn/collective/inquant.contentmirror.plone/trunkr   Nr+   r   r$   s   &   r   test_bad_url_typo"TestPackageIndex.test_bad_url_typo    sv     ((55<P5Q]]]9BIIcN;;s#Aa!7!78888 <;;;s   >B$$B5	c                    \         P                  P                  RR7      pR pW!n        Rp\        P
                  ! \        RR7      ;_uu_ 4        VP                  V4       RRR4       R#   + '       g   i     R# ; i)r+   r,   c                  @    \         P                  P                  R 4      h)line)httpclientBadStatusLine)argss   *r   _urlopen?TestPackageIndex.test_bad_url_bad_status_line.<locals>._urlopen/   s    ++++F33r   zhttp://example.comr3   r   Nr.   )r   r   r   openerr   r   r   r   )r   r%   r8   r&   s   &   r   test_bad_url_bad_status_line-TestPackageIndex.test_bad_url_bad_status_line,   sY    ((55<P5Q	4  "]]9G44NN3 5444s   A,,A=	c                   \         P                  P                  RR7      pRp VP                  V4       \        R4      h  \        P
                  P                   d.   p\        T4      pRT9   g   RT9   g
   RT9   g   Q h Rp?R# Rp?ii ; i)	z?
A bad URL with a double scheme should raise a DistutilsError.
r,   z2http://http://svn.pythonpaste.org/Paste/wphp/trunkznonnumeric portzgetaddrinfo failedzName or service not knownNzDid not raiser.   )	r   r   r   r   	distutilserrorsDistutilsErrorstrRuntimeError)r   r%   r&   r"   msgs   &    r   test_bad_url_double_scheme+TestPackageIndex.test_bad_url_double_scheme7   s     ((55<P5Q C		NN3 ?++ .. 	e*C!S('3..#56 	s   A   B"BBc                ~    \         P                  P                  RR7      pRpVP                  VR4      '       g   Q hR# )r+   r,   zfile:///tmp/test_package_indexTNr.   )r   r   r   url_ok)r   r%   r&   s   &  r   test_url_okTestPackageIndex.test_url_okK   s8    ((55<P5Q.||C&&&&r   c                    \         P                  P                  pV! R 4      pRpW#8X  g   Q hV! R4      pRpW#8X  g   Q hV! R4      pRpW#8X  g   Q hV! R4      pRpW#8X  g   Q hR# )	zreportlab-2.5.win32-py2.4.exezreportlab-2.5.win32.exeNz!reportlab-2.5.win-amd64-py2.7.exezreportlab-2.5.win-amd64.exe)reportlab-2.5z2.4win32)rK   NrL   )rK   z2.7	win-amd64)rK   NrM   )r   r   parse_bdist_wininst)r   parseactualexpecteds   &   r   test_parse_bdist_wininst)TestPackageIndex.test_parse_bdist_wininstP   s    ((<<672!!!011!!!:;6!!!455!!!r   c                    \         P                  P                  P                  pV! R4      w  r#VR8X  g   Q hVR8X  g   Q hR# )z1
Test the basic usage of _vcs_split_rev_from_url
zhttps://example.com/bar@2995zhttps://example.com/bar2995N)r   r   r   _vcs_split_rev_from_url)r   vsrfur&   revs   &   r   test__vcs_split_rev_from_url-TestPackageIndex.test__vcs_split_rev_from_urlc   sC     ((55MM78////f}}r   c                |   VR,          pVP                  R4      ;_uu_ 4       pVP                  R4       RRR4       R\        P                  P	                  \        V4      4      ,           R,           p\        P                  P                  V4      pRVP                  4       9   g   Q hR#   + '       g   i     L~; i)zB
local_open should be able to read an index from the file system.
z
index.htmlwz<div>content</div>Nzfile:/content)
openwriter!   requestpathname2urlrA   r   r   
local_openread)r   tmpdir
index_filefr&   ress   &&    r   test_local_index!TestPackageIndex.test_local_indexl   s     l*
__S!!QGG() "33CK@@3F&&11#6CHHJ&&&	 "!s   B++B;	c                   RR.p. ROp. ROpR.pR.p. R	OpV UUU	U
Uu. uFN  pV FE  p\        W4V.R.4       F/  p	V F&  p
V
 Uu. uF  pRP                  WxW.4      NK  	  upNK(  	  K1  	  KG  	  KP  	  pp
p	pppV Fh  w  r\        \        P                  P                  RV,           4      4      pV^ ,          P                  R8X  g   Q hV^,          P                  V8X  d   Kh  Q h	  R# u upi u upp
p	ppi )
z&
EGG fragments must comply to PEP 440
 z1!z.post0z.dev0z3http://example.com/example-foo.zip#egg=example-foo-N)0z0.0z0.0.0)a0b0rc0))rl   rl   )	+ubuntu.0rq   )z	+ubuntu-0rq   )z	+ubuntu_0rq   )sumjoinlistr   r   distros_for_urlversion)r   epochreleasesprepostdevlocalerplocslocversionsr'   vcdistss   &               r   test_egg_fragment"TestPackageIndex.test_egg_fragmentw   s    
 




 z

 
#S)B40	 155RWWaA^$5 	 6 1 6 6 	 
 EA((88IAME
 8##r)))8##r)))  6
s   %C.C) C.)C.c                0   R p\         P                  P                  4       pVR,          pVP                  RRRRV.4       VP                  RRVRRR.4       VP	                  W14      pV\        V4      8X  g   Q h\        VP                  4      ^8X  g   Q hR	# )
z7git+https://github.example/group/project@master#egg=foozproject@mastergitclone--quiet$https://github.example/group/projectz-CcheckoutmasterN)r   r   r   registerdownloadrA   lencalls)r   tmp_pathfpr&   r%   expected_dirresults   &&&    r   test_download_git_with_rev+TestPackageIndex.test_download_git_with_rev   s    G((557"22
2
 	 	UD,
IxPQ.\****288}!!!r   c                    R p\         P                  P                  4       pVR,          pVP                  RRRRV.4       VP	                  W14       R# )z0git+https://github.example/group/project#egg=fooprojectr   r   r   r   N)r   r   r   r   r   )r   r   r   r&   r%   r   s   &&&   r   test_download_git_no_rev)TestPackageIndex.test_download_git_no_rev   sS    @((557)+
2
 	 	s%r   c                   R p\         P                  P                  4       pRp\        P                  ! \
        P                  P                  VR7      ;_uu_ 4        VP                  W!4       RRR4       R#   + '       g   i     R# ; i)z'svn+https://svn.example/project#egg=fooz!.*SVN download is not supported.*r   N)	r   r   r   r   r   r>   r?   r@   r   )r   r   r&   r%   rC   s   &&   r   test_download_svn"TestPackageIndex.test_download_svn   sY    7((5572]]9++::#FFNN3) GFFFs   A77B	r   N)__name__
__module____qualname____firstlineno__r   r(   r/   r;   rD   rH   rR   rY   ri   r   r   r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      sL     <9
9	 ,('
"&	'**X"&&* *r   r   c                   >   a  ] tR t^t o R tR tR tR tR tRt	V t
R# )TestContentCheckersc                
   \         P                  P                  P                  R 4      pVP	                  RP                  R4      4       VP                  P                  4       R8X  g   Q hVP                  4       '       g   Q hR# )3http://foo/bar#md5=f12895fdffbd45007040d2e44df98478z$You should probably not be using MD5ascii f12895fdffbd45007040d2e44df98478N)	r   r   HashCheckerfrom_urlfeedencodehash	hexdigestis_validr   checkers   & r   test_md5TestContentCheckers.test_md5   sl    **66??A
 	;BB7KL||%%'+MMMM!!!!r   c                    \         P                  P                  P                  R4      pVP	                  RP                  R4      4       VP                  4       '       g   Q hR# )z<Content checks should succeed silently if no hash is presentz1http://foo/bar#something%20completely%20differentanythingr   Nr   r   r   r   r   r   r   r   s   & r   test_other_fragment'TestContentCheckers.test_other_fragment   sO    **66???
 	Z&&w/0!!!!r   c                    \         P                  P                  P                  R4      pVP	                  RP                  R4      4       VP                  4       '       g   Q hR# )z0Content checks should succeed if a hash is emptyzhttp://foo/bar#md5=r   r   Nr   r   s   & r   test_blank_md5"TestContentCheckers.test_blank_md5   sK    **66??@UVZ&&w/0!!!!r   c                ~    \         P                  P                  P                  R 4      pVP                  R8X  g   Q hR# )r   md5N)r   r   r   r   	hash_namer   s   & r   test_get_hash_name_md5*TestContentCheckers.test_get_hash_name_md5   s7    **66??A
   E)))r   c                    \         P                  P                  P                  R 4      pVP	                  R R4      pVR8X  g   Q hR# )r   c                     V # )Nr   )xs   &r   <lambda>1TestContentCheckers.test_report.<locals>.<lambda>   s    qr   zMy message about %szMy message about md5N)r   r   r   r   report)r   r   reps   &  r   test_reportTestContentCheckers.test_report   sC    **66??A
 nn[*?@,,,,r   r   N)r   r   r   r   r   r   r   r   r   r   r   r   s   @r   r   r      s#     """*- -r   r   c                   &   a  ] tR t^t o R tRtV tR# )TestPyPIConfigc                    VR ,          pVP                  \        R4      RR7       \        P                  P	                  4       pVP
                  R,          pVP                  R8X  g   Q hVP                  R8X  g   Q hR# )z.pypircz
                [pypi]
                repository=https://pypi.org
                username=jaraco
                password=pity%
                zutf-8)encodingzhttps://pypi.orgjaracozpity%N)
write_textr   r   r   
PyPIConfigcreds_by_repositoryusernamepassword)r   tmp_home_dirpypirccfgcreds   &&   r   test_percent_in_password'TestPyPIConfig.test_percent_in_password   s|    	)  	 
	
 &&113&&'9:}}(((}}'''r   r   N)r   r   r   r   r   r   r   r   s   @r   r   r      s     ( (r   r   c                 X    \         P                  P                  P                  R4       R# )z3
REL should not hang on a contrived attack string.
Na  < rel=                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                )r   r   RELsearchr   r   r   test_REL_DoSr     s    
   ''(>?r   )http.clientr4   r   urllib.errorr!   urllib.requestinspectr   r   setuptools.package_indexr   distutils.errorsr>   r   r   r   marktimeoutr   r   r   r   <module>r      sd     	      |* |*~"- "-J( (( Q@ @r   