Your IP : 216.73.216.85


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-2.pyc



���]�@sddlZddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dZd	Zd
ZGdd�dejejejej�ZGd
d�de�Zdd�Zedkre
e��dS)�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)N�HOMEz.pypircc@s.eZdZdd�Zdd�ZeZdS)z0BasePyPIRCCommandTestCase.setUp.<locals>.commandcSstj||�dS)N)r�__init__)�self�dist�r
�0/opt/alt/python35/lib64/python3.5/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r)�superr�setUp�mkdtempZtmp_dir�os�environ�path�join�rcrrr�_cmdrr�
old_threshold)rr)�	__class__r
rr<s	zBasePyPIRCCommandTestCase.setUpcs$t|j�tt|�j�dS)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�readr3�WANTED�close)rr5r�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!rA)r#r$)r%rB)r'r@)r)rC)r-rr.rrr%r/r0r1r2r3)rr5r6r7r
r
r�test_config_interpolation|s	z/PyPIRCCommandTestCase.test_config_interpolationN)rrrr8r?rDr
r
r
rr Ts
r cCs
tjt�S)N)�unittestZ	makeSuiter r
r
r
r�
test_suite�srF�__main__)�sysrrE�tempfileZdistutils.corerrZ
distutils.logrrZdistutils.testsrZtest.supportrr.r4r<ZTempdirManagerZLoggingSilencerZEnvironGuardZTestCaserr rFrr
r
r
r�<module>s(
6