Ñò
˜à"Ic        	   @   s³   d  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 Z	 d Z
 d e i e i f d	 „  ƒ  YZ d
 „  Z e d j o e i d d ƒ n d S(   s"   Tests for distutils.pypirc.pypirc.iÿÿÿÿN(   t   PyPIRCCommand(   t   Distribution(   t   supports´   [distutils]

index-servers =
    server1
    server2

[server1]
username:me
password:secret

[server2]
username:meagain
password: secret
realm:acme
repository:http://another.pypi/
s.   [server-login]
username:tarek
password:secret
t   PyPIRCCommandTestCasec           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s–   t  i i d ƒ o t  i d |  _ n
 d |  _ t  i i t ƒ } | t  i d <t  i i | d ƒ |  _	 t
 ƒ  |  _ d t f d „  ƒ  Y} | |  _ d S(   s   Patches the environment.t   HOMEs   .pypirct   commandc           B   s    e  Z d  „  Z d „  Z e Z RS(   c         S   s   t  i |  | ƒ d  S(   N(   R    t   __init__(   t   selft   dist(    (    s8   /mit/python/lib/python2.6/distutils/tests/test_config.pyR   1   s    c         S   s   d  S(   N(    (   R   (    (    s8   /mit/python/lib/python2.6/distutils/tests/test_config.pyt   initialize_options3   s    (   t   __name__t
   __module__R   R	   t   finalize_options(    (    (    s8   /mit/python/lib/python2.6/distutils/tests/test_config.pyR   0   s   		N(   t   ost   environt   has_keyt	   _old_homet   Nonet   patht   dirnamet   __file__t   joint   rcR   R   R    t   _cmd(   R   t   curdirR   (    (    s8   /mit/python/lib/python2.6/distutils/tests/test_config.pyt   setUp%   s    	c         C   s\   |  i  d j o t i d =n |  i  t i d <t i i |  i ƒ o t i |  i ƒ n d S(   s   Removes the patch.R   N(   R   R   R   R   R   t   existsR   t   remove(   R   (    (    s8   /mit/python/lib/python2.6/distutils/tests/test_config.pyt   tearDown9   s
    c      	   C   sþ   t  |  i d ƒ } z | i t ƒ Wd  | i ƒ  X|  i |  i ƒ } | i ƒ  } | i ƒ  } | i	 ƒ  d d d d d g } |  i
 | | ƒ t  |  i d ƒ } | i t ƒ | i ƒ  | i ƒ  } | i ƒ  } | i	 ƒ  d d d d d g } |  i
 | | ƒ d  S(   Nt   wt   passwordt   secrett   realmt   pypit
   repositorys   http://pypi.python.org/pypit   servert   server1t   usernamet   mes   server-logint   tarek(   R   R   (   R    R!   (   R"   s   http://pypi.python.org/pypi(   R#   R$   (   R%   R&   (   R   R   (   R    R!   (   R"   s   http://pypi.python.org/pypi(   R#   s   server-login(   R%   R'   (   t   openR   t   writet   PYPIRCt   closeR   R   t   _read_pypirct   itemst   sortt   assertEqualst
   PYPIRC_OLD(   R   t   ft   cmdt   configt   waited(    (    s8   /mit/python/lib/python2.6/distutils/tests/test_config.pyt   test_server_registrationB   s,    


(   R
   R   R   R   R5   (    (    (    s8   /mit/python/lib/python2.6/distutils/tests/test_config.pyR   #   s   			c           C   s   t  i t ƒ S(   N(   t   unittestt	   makeSuiteR   (    (    (    s8   /mit/python/lib/python2.6/distutils/tests/test_config.pyt
   test_suitee   s    t   __main__t   defaultTestR8   (   t   __doc__t   sysR   R6   t   distutils.coreR    R   t   distutils.testsR   R*   R0   t   TempdirManagert   TestCaseR   R8   R
   t   main(    (    (    s8   /mit/python/lib/python2.6/distutils/tests/test_config.pyt   <module>   s   B	