HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/distutils/tests/__pycache__/test_config.cpython-310.pyc
o

�i4�@s�dZddlZddlZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZd	Z
d
ZdZGdd
�d
e
je
je
jej�ZGdd�de�Zdd�ZedkrZee��dSdS)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.�HOME�USERPROFILEz.pypircc@s eZdZdd�Zdd�ZeZdS)z0BasePyPIRCCommandTestCase.setUp.<locals>.commandcSst�||�dS�N)r�__init__)�self�dist�r�8/usr/local/lib/python3.10/distutils/tests/test_config.pyrDsz9BasePyPIRCCommandTestCase.setUp.<locals>.command.__init__cSsdSrr�r
rrr�initialize_optionsFszCBasePyPIRCCommandTestCase.setUp.<locals>.command.initialize_optionsN)�__name__�
__module__�__qualname__rrZfinalize_optionsrrrr�commandCsrN)�superr�setUp�mkdtempZtmp_dir�os�environ�path�join�rcrrr�_cmdrr�
old_threshold)r
r��	__class__rrr:s
zBasePyPIRCCommandTestCase.setUpcst|j�tt|���dS)zRemoves the patch.N)rr rr�tearDownrr!rrr#Ms
z"BasePyPIRCCommandTestCase.tearDown)rrrrr#�
__classcell__rrr!rr5s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_registrationcCsz|�|j�}|��}|�tj�|��|�dd�|�tj�|��t	|�}z|�
�}|�|t�W|�
�dS|�
�w)Nr.Zxxx)rrZ_get_rc_fileZassertFalserr�existsZ
_store_pypircZ
assertTrue�open�readr5�WANTED�close)r
r8r�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+rA)r,Zcbiggles)r/rr0rrr*r1r2r3r4r5r7rrr�test_config_interpolation{sz/PyPIRCCommandTestCase.test_config_interpolationN)rrrr9r@rBrrrrr%Ss
r%cCs
t�t�Sr)�unittestZ	makeSuiter%rrrr�
test_suite�s
rD�__main__)�__doc__rrCZdistutils.corerrZ
distutils.logrrZdistutils.testsrZtest.supportrr0r6r=ZTempdirManagerZLoggingSilencerZEnvironGuardZTestCaserr%rDrrrrr�<module>s,�6�