Your IP : 216.73.216.213


Current Path : /opt/alt/python39/lib64/python3.9/distutils/tests/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/distutils/tests/__pycache__/test_config.cpython-39.opt-1.pyc

a

XC?h4�@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)�BasePyPIRCCommandTestCasecsntt|���|��|_|jtjd<|jtjd<tj�|jd�|_	t
�|_Gdd�dt�}||_
tt�|_dS)zPatches the environment.�HOMEZUSERPROFILEz.pypircc@s eZdZdd�Zdd�ZeZdS)z0BasePyPIRCCommandTestCase.setUp.<locals>.commandcSst�||�dS�N)r�__init__)�self�dist�r�@/opt/alt/python39/lib64/python3.9/distutils/tests/test_config.pyrDsz9BasePyPIRCCommandTestCase.setUp.<locals>.command.__init__cSsdSr
r�rrrr�initialize_optionsFszCBasePyPIRCCommandTestCase.setUp.<locals>.command.initialize_optionsN)�__name__�
__module__�__qualname__rrZfinalize_optionsrrrr�commandCsrN)�superr�setUpZmkdtempZtmp_dir�os�environ�path�join�rcrr
r�_cmdrr�
old_threshold)rr��	__class__rrr:s
zBasePyPIRCCommandTestCase.setUpcst|j�tt|���dS)zRemoves the patch.N)rrrr�tearDownrrrrr!Ms
z"BasePyPIRCCommandTestCase.tearDown)rrrrr!�
__classcell__rrrrr5src@s$eZdZdd�Zdd�Zdd�ZdS)�PyPIRCCommandTestCasecCs�|�|jt�|�|j�}|��}tt|����}gd�}|�	||�|�|jt
�|��}tt|����}gd�}|�	||�dS)N)��passwordZsecret�ZrealmZpypi��
repositoryzhttps://upload.pypi.org/legacy/)�serverZserver1)�username�me)r$r&r')r)zserver-login)r*�tarek)�
write_filer�PYPIRCrr
�_read_pypirc�list�sorted�items�assertEqual�
PYPIRC_OLD�r�cmdZconfigZwaitedrrr�test_server_registrationUsz.PyPIRCCommandTestCase.test_server_registrationcCs||�|j�}|��}|�tj�|��|�dd�|�tj�|��t	|�}z |�
�}|�|t�W|�
�n
|�
�0dS)Nr,Zxxx)rr
Z_get_rc_fileZassertFalserr�existsZ
_store_pypircZ
assertTrue�open�readr3�WANTED�close)rr6r�fZcontentrrr�test_server_empty_registrationnsz4PyPIRCCommandTestCase.test_server_empty_registrationcCsP|�|jt�|�|j�}d|_|��}tt|�	���}gd�}|�
||�dS)N�server3))r%zyh^%#rest-of-my-passwordr&r')r)r?)r*Zcbiggles)r-rr.rr
r(r/r0r1r2r3r5rrr�test_config_interpolation{sz/PyPIRCCommandTestCase.test_config_interpolationN)rrrr7r>r@rrrrr#Ss
r#cCs
t�t�Sr
)�unittestZ	makeSuiter#rrrr�
test_suite�srB�__main__)�__doc__rrAZdistutils.corerrZ
distutils.logrrZdistutils.testsrZtest.supportrr.r4r;ZTempdirManagerZLoggingSilencerZEnvironGuardZTestCaserr#rBrrrrr�<module>s(�6