Your IP : 216.73.216.213


Current Path : /opt/alt/python36/lib64/python3.6/distutils/tests/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/distutils/tests/__pycache__/test_config.cpython-36.opt-1.pyc

3

� f�@s�dZddlZddlZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZd	Z
d
ZdZGdd
�d
e
je
je
jej�ZGdd�de�Zdd�Zedkr�ee��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
cs(eZdZ�fdd�Z�fdd�Z�ZS)�BasePyPIRCCommandTestCasecsbtt|�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/python36/lib64/python3.6/distutils/tests/test_config.pyr
Csz9BasePyPIRCCommandTestCase.setUp.<locals>.command.__init__cSsdS)Nr
)rr
r
r�initialize_optionsEszCBasePyPIRCCommandTestCase.setUp.<locals>.command.initialize_optionsN)�__name__�
__module__�__qualname__r
rZfinalize_optionsr
r
r
r�commandBsrN)�superr�setUpZmkdtempZtmp_dir�os�environ�path�join�rcrrr�_cmdrr�
old_threshold)rr)�	__class__r
rr:s
zBasePyPIRCCommandTestCase.setUpcst|j�tt|�j�dS)zRemoves the patch.N)rrrr�tearDown)r)rr
rrLs
z"BasePyPIRCCommandTestCase.tearDown)rrrrr�
__classcell__r
r
)rrr5src@s$eZdZdd�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_registrationTsz.PyPIRCCommandTestCase.test_server_registrationc
Cst|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�readr3�WANTED�close)rr5r�fZcontentr
r
r�test_server_empty_registrationmsz4PyPIRCCommandTestCase.test_server_empty_registrationcCsV|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!rA)r#r$)r%rB)r'r@)r)rC)r-rr.rrr%r/r0r1r2r3)rr5r6r7r
r
r�test_config_interpolationzsz/PyPIRCCommandTestCase.test_config_interpolationN)rrrr8r?rDr
r
r
rr Rs
r cCs
tjt�S)N)�unittestZ	makeSuiter r
r
r
r�
test_suite�srF�__main__)�__doc__rrEZdistutils.corerrZ
distutils.logrrZdistutils.testsrZtest.supportrr.r4r<ZTempdirManagerZLoggingSilencerZEnvironGuardZTestCaserr rFrr
r
r
r�<module>s&
6