Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/distutils/tests/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/distutils/tests/__pycache__/test_config.cpython-35.opt-1.pyc



��Yf�@sdZddlZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZddl
mZd	Zd
ZdZGdd
�d
ejejejej�ZGdd�de�Zdd�Zedkree��dS)z"Tests for distutils.pypirc.pypirc.�N)�
PyPIRCCommand)�Distribution)�
set_threshold)�WARN)�support)�run_unittestz�[distutils]

index-servers =
    server1
    server2
    server3

[server1]
username:me
password:secret

[server2]
username:meagain
password: secret
realm:acme
repository:http://another.pypi/

[server3]
username:cbiggles
password:yh^%#rest-of-my-password
z.[server-login]
username:tarek
password:secret
zI[distutils]
index-servers =
    pypi

[pypi]
username:tarek
password:xxx
cs4eZdZ�fdd�Z�fdd�Z�S)�BasePyPIRCCommandTestCasecs�tt|�j�|j�|_|jtjd<tjj|jd�|_	t
�|_Gdd�dt�}||_
tt�|_dS)zPatches the environment.�HOMEz.pypircc@s.eZdZdd�Zdd�ZeZdS)z0BasePyPIRCCommandTestCase.setUp.<locals>.commandcSstj||�dS)N)r�__init__)�self�dist�r
�@/opt/alt/python35/lib64/python3.5/distutils/tests/test_config.pyr
Esz9BasePyPIRCCommandTestCase.setUp.<locals>.command.__init__cSsdS)Nr
)rr
r
r�initialize_optionsGszCBasePyPIRCCommandTestCase.setUp.<locals>.command.initialize_optionsN)�__name__�
__module__�__qualname__r
rZfinalize_optionsr
r
r
r�commandDsrN)�superr�setUpZmkdtempZtmp_dir�os�environ�path�join�rcrrr�_cmdrr�
old_threshold)rr)�	__class__r
rr<s	zBasePyPIRCCommandTestCase.setUpcs$t|j�tt|�j�dS)zRemoves the patch.N)rrrr�tearDown)r)rr
rrNs
z"BasePyPIRCCommandTestCase.tearDown)rrrrrr
r
)rrr7src@s4eZdZdd�Zdd�Zdd�ZdS)�PyPIRCCommandTestCasecCs�|j|jt�|j|j�}|j�}tt|j���}d
ddddg}|j	||�|j|jt
�|j�}tt|j���}dddddg}|j	||�dS)N�password�secret�realm�pypi�
repository�https://upload.pypi.org/legacy/�server�server1�username�me�server-login�tarek)r r!)r"r#)r$r%)r&r')r(r))r r!)r"r#)r$r%)r&r*)r(r+)�
write_filer�PYPIRCrr�_read_pypirc�list�sorted�items�assertEqual�
PYPIRC_OLD)r�cmd�config�waitedr
r
r�test_server_registrationVsz.PyPIRCCommandTestCase.test_server_registrationc
Cs�|j|j�}|j�}|jtjj|��|jdd�|jtjj|��t	|�}z |j
�}|j|t�Wd|j
�XdS)Nr+Zxxx)rrZ_get_rc_fileZassertFalserr�existsZ
_store_pypircZ
assertTrue�open�readr2�WANTED�close)rr4r�fZcontentr
r
r�test_server_empty_registrationosz4PyPIRCCommandTestCase.test_server_empty_registrationcCs{|j|jt�|j|j�}d|_|j�}tt|j	���}ddd
ddg}|j
||�dS)N�server3r �yh^%#rest-of-my-passwordr"r#r$�https://upload.pypi.org/legacy/r&r(�cbiggles)r r@)r"r#)r$rA)r&r?)r(rB)r,rr-rrr$r.r/r0r1r2)rr4r5r6r
r
r�test_config_interpolation|s	z/PyPIRCCommandTestCase.test_config_interpolationN)rrrr7r>rCr
r
r
rrTs
rcCs
tjt�S)N)�unittestZ	makeSuiterr
r
r
r�
test_suite�srE�__main__)�__doc__�sysrrDZtempfileZdistutils.corerrZ
distutils.logrrZdistutils.testsrZtest.supportrr-r3r;ZTempdirManagerZLoggingSilencerZEnvironGuardZTestCaserrrErr
r
r
r�<module>s*
6