Ñò
Ùè Kc        
   @   sw   d  Z  d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d e i	 f d „  ƒ  YZ
 d S(   s   Package Index Tests
iÿÿÿÿNt   TestPackageIndexc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s¸  t  i i ƒ  } d } y | i | ƒ } Wn. t j
 o" } |  i | t | ƒ j ƒ n X|  i t | t i	 ƒ ƒ t  i i d d ƒ } d } y | i | ƒ } Wn. t j
 o" } |  i | t | ƒ j ƒ n X|  i t | t i	 ƒ ƒ d „  } t i
 } | t _
 d } zT y | i | ƒ } Wn. t j
 o" } |  i d t | ƒ j ƒ n Xt d ƒ ‚ Wd  | t _
 Xd	 } y | i | ƒ Wn. t j
 o" } |  i d
 t | ƒ j ƒ n Xd  S(   Ns,   http://127.0.0.1/nonesuch/test_package_indext   hostss   www.example.comsM   url:%20https://svn.plone.org/svn/collective/inquant.contentmirror.plone/trunkc          W   s   d d  k  } | i d ƒ ‚ d  S(   Niÿÿÿÿt   line(   t   httplibt   BadStatusLine(   t   argsR   (    (    sF   /usr/lib/python2.6/dist-packages/setuptools/tests/test_packageindex.pyt   _urlopen$   s    s   http://example.comR   s   Should have raise here!s2   http://http://svn.pythonpaste.org/Paste/wphp/trunks   nonnumeric port(   s   www.example.com(   t
   setuptoolst   package_indext   PackageIndext   open_urlt	   Exceptiont   assert_t   strt
   isinstancet   urllib2t	   HTTPErrort   urlopent   AssertionError(   t   selft   indext   urlt   vR   t   old_urlopen(    (    sF   /usr/lib/python2.6/dist-packages/setuptools/tests/test_packageindex.pyt   test_bad_urls   s>    				
c         C   s8   t  i i d d ƒ } d } |  i | i | t ƒ ƒ d  S(   NR   s   www.example.coms   file:///tmp/test_package_index(   s   www.example.com(   R   R   R	   R   t   url_okt   True(   R   R   R   (    (    sF   /usr/lib/python2.6/dist-packages/setuptools/tests/test_packageindex.pyt   test_url_ok<   s    	(   t   __name__t
   __module__R   R   (    (    (    sF   /usr/lib/python2.6/dist-packages/setuptools/tests/test_packageindex.pyR    	   s   	1(   t   __doc__t   ost   shutilt   tempfilet   unittestR   t   pkg_resourcest   setuptools.package_indexR   t   TestCaseR    (    (    (    sF   /usr/lib/python2.6/dist-packages/setuptools/tests/test_packageindex.pyt   <module>   s   <