Ñò
b-äQc           @   sÓ   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 d k l Z d d k	 l
 Z
 d d k l Z d d k l Z d d k l Z d Z d	 Z d
 e i f d „  ƒ  YZ d S(   s   develop tests
iÿÿÿÿN(   t   DistutilsError(   t   develop(   t   easy_install(   t   StringIO(   t   Distributions[   from setuptools import setup

setup(name='foo',
    packages=['foo'],
    use_2to3=True,
)
s   print "foo"
t   TestDevelopTestc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s+  t  i d j  p t t  d ƒ o d  St i ƒ  |  _ t i t i i	 |  i d ƒ ƒ t i i	 |  i d ƒ } t
 | d ƒ } | i t ƒ | i ƒ  t i ƒ  |  _ t i i	 |  i d d ƒ } t
 | d ƒ } | i t ƒ | i ƒ  t i |  i ƒ t i |  _ t i ƒ  t _ t i |  _ t i ƒ  t _ d  S(   Ns   2.6t   real_prefixt   foos   setup.pyt   ws   __init__.py(   t   syst   versiont   hasattrt   tempfilet   mkdtempt   dirt   ost   mkdirt   patht   joint   opent   writet   SETUP_PYt   closet   getcwdt   old_cwdt   INIT_PYt   chdirt   sitet	   USER_BASEt   old_baset	   USER_SITEt   old_site(   t   selft   setupt   ft   init(    (    sY   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/tests/test_develop.pyt   setUp   s$     

c         C   s¤   t  i d j  p3 t t  d ƒ p# t t  d ƒ o t  i t  i j o d  St i |  i ƒ t i	 |  i
 ƒ t i	 t i ƒ t i	 t i ƒ |  i t _ |  i t _ d  S(   Ns   2.6R   t   base_prefix(   R	   R
   R   R%   t   prefixR   R   R   t   shutilt   rmtreeR   R   R   R   R   R   (   R    (    (    sY   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/tests/test_develop.pyt   tearDown5   s    Cc   	      C   s®  t  i d j  p t t  d ƒ o d  St t d d d d g d t d d ƒ ƒ } d	 | _ t | ƒ } d
 | _ | i	 ƒ  t
 i | _ d
 | _ t  i } z | i ƒ  Wd  | t  _ Xt i t
 i ƒ } | i ƒ  |  i | d d g ƒ t t i i t
 i d ƒ d ƒ } z  | i ƒ  i ƒ  d i ƒ  } Wd  | i ƒ  Xt t i i | d d ƒ d ƒ } z | i ƒ  i ƒ  } Wd  | i ƒ  Xt  i d j  o |  i | d ƒ n |  i | d ƒ d  S(   Ns   2.6R   t   nameR   t   packagest   use_2to3R
   s   0.0s   setup.pyi   s   easy-install.pths   foo.egg-linkt   rti    s   __init__.pyt   3s   print "foo"s   print("foo")(   R	   R
   R   R   t   dictt   Truet   script_nameR   t   usert   ensure_finalizedR   R   t   install_dirt   stdoutt   runR   t   listdirt   sortt   assertEqualR   R   R   t   readt   splitt   stripR   (	   R    t   distt   cmdt
   old_stdoutt   contentt   egg_link_fileR   t	   init_fileR#   (    (    sY   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/tests/test_develop.pyt   test_develop@   s>     			
		

! !c      
   C   s˜   d } t  i ƒ  } t  i |  i ƒ za y t h d g d 6ƒ } Wn@ t j
 o4 t i ƒ  d } t | ƒ } | | j o q‚ n XWd  t  i | ƒ Xd  S(   NsJ   Could not find suitable distribution for Requirement.parse('I-DONT-EXIST')t   I_DONT_EXISTt   setup_requiresi   (	   R   R   R   R   R   R    R	   t   exc_infot   str(   R    t   wantedt   old_dirR=   t   et   error(    (    sY   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/tests/test_develop.pyt"   notest_develop_with_setup_requiresk   s    (   t   __name__t
   __module__R$   R)   RC   RL   (    (    (    sY   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/tests/test_develop.pyR      s   			+(   t   __doc__R	   R   R'   R   t   unittestR   t   distutils.errorsR    t   setuptools.command.developR   t   setuptools.commandR   t   easy_install_pkgt   setuptools.compatR   t   setuptools.distR   R   R   t   TestCaseR   (    (    (    sY   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/tests/test_develop.pyt   <module>   s   0	