§
    •Õ*j»  ã                   óö   — d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 dZd	Zd
Z G d„ de
j        e
j        e
j        ej        ¦  «        Z G d„ de¦  «        Zedk    r ej        ¦   «          dS dS )z"Tests for distutils.pypirc.pypirc.é    N)ÚPyPIRCCommand)ÚDistribution)Úset_threshold)ÚWARN)Úsupportzÿ[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
c                   ó(   ‡ — e Zd Zˆ fd„Zˆ fd„Zˆ xZS )ÚBasePyPIRCCommandTestCasec                 ó¸  •— t          t          | ¦  «                             ¦   «          |                      ¦   «         | _        | j        t
          j        d<   | j        t
          j        d<   t
          j                             | j        d¦  «        | _	        t          ¦   «         | _         G d„ dt          ¦  «        }|| _        t          t          ¦  «        | _        dS )zPatches the environment.ÚHOMEÚUSERPROFILEz.pypircc                   ó   — e Zd Zd„ Zd„ ZeZdS )ú0BasePyPIRCCommandTestCase.setUp.<locals>.commandc                 ó0   — t          j        | |¦  «         d S ©N)r   Ú__init__)ÚselfÚdists     á-  /home/task_178118881339430/croot/python-split_1781190639776/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.11/distutils/tests/test_config.pyr   z9BasePyPIRCCommandTestCase.setUp.<locals>.command.__init__C   s   € ÝÔ& t¨TÑ2Ô2Ð2Ð2Ð2ó    c                 ó   — d S r   © )r   s    r   Úinitialize_optionszCBasePyPIRCCommandTestCase.setUp.<locals>.command.initialize_optionsE   s   € Ø�r   N)Ú__name__Ú
__module__Ú__qualname__r   r   Úfinalize_optionsr   r   r   Úcommandr   B   s4   € € € € € ð3ð 3ð 3ðð ð à1ÐÐÐr   r   N)Úsuperr	   ÚsetUpÚmkdtempÚtmp_dirÚosÚenvironÚpathÚjoinÚrcr   r   r   Ú_cmdr   r   Úold_threshold)r   r   Ú	__class__s     €r   r   zBasePyPIRCCommandTestCase.setUp9   s¸   ø€ åÕ'¨Ñ.Ô.×4Ò4Ñ6Ô6Ð6Ø—|’|‘~”~ˆŒØ!œ\�Œ
�6ÑØ$(¤L�Œ
�=Ñ!Ý”'—,’,˜tœ|¨YÑ7Ô7ˆŒÝ ‘N”NˆŒ	ð	2ð 	2ð 	2ð 	2ð 	2•mñ 	2ô 	2ð 	2ð ˆŒ	Ý*­4Ñ0Ô0ˆÔÐÐr   c                 ó~   •— t          | j        ¦  «         t          t          | ¦  «                             ¦   «          dS )zRemoves the patch.N)r   r(   r   r	   ÚtearDown)r   r)   s    €r   r+   z"BasePyPIRCCommandTestCase.tearDownL   s7   ø€ å�dÔ(Ñ)Ô)Ð)ÝÕ'¨Ñ.Ô.×7Ò7Ñ9Ô9Ð9Ð9Ð9r   )r   r   r   r   r+   Ú__classcell__)r)   s   @r   r	   r	   4   sQ   ø€ € € € € ð
1ð 1ð 1ð 1ð 1ð&:ð :ð :ð :ð :ð :ð :ð :ð :r   r	   c                   ó    — e Zd Zd„ Zd„ Zd„ ZdS )ÚPyPIRCCommandTestCasec                 ó*  — |                       | j        t          ¦  «         |                      | j        ¦  «        }|                     ¦   «         }t          t          |                     ¦   «         ¦  «        ¦  «        }g d¢}|  	                    ||¦  «         |                       | j        t          ¦  «         |                     ¦   «         }t          t          |                     ¦   «         ¦  «        ¦  «        }g d¢}|  	                    ||¦  «         d S )N)©ÚpasswordÚsecret©ÚrealmÚpypi©Ú
repositoryzhttps://upload.pypi.org/legacy/)ÚserverÚserver1)ÚusernameÚme)r0   r3   r6   )r8   zserver-login)r:   Útarek)Ú
write_filer&   ÚPYPIRCr'   r   Ú_read_pypircÚlistÚsortedÚitemsÚassertEqualÚ
PYPIRC_OLD©r   ÚcmdÚconfigÚwaiteds       r   Útest_server_registrationz.PyPIRCCommandTestCase.test_server_registrationT   sü   € ð 	�Š˜œ¥Ñ(Ô(Ð(Ø�iŠi˜œ	Ñ"Ô"ˆØ×!Ò!Ñ#Ô#ˆå•f˜VŸ\š\™^œ^Ñ,Ô,Ñ-Ô-ˆð=ð =ð =ˆð 	×Ò˜ Ñ(Ô(Ð(ð 	�Š˜œ¥Ñ,Ô,Ð,Ø×!Ò!Ñ#Ô#ˆÝ•f˜VŸ\š\™^œ^Ñ,Ô,Ñ-Ô-ˆðEð Eð Eˆð 	×Ò˜ Ñ(Ô(Ð(Ð(Ð(r   c                 ó.  — |                       | j        ¦  «        }|                     ¦   «         }|                      t          j                             |¦  «        ¦  «         |                     dd¦  «         |                      t          j                             |¦  «        ¦  «         t          |¦  «        }	 | 
                    ¦   «         }|                      |t          ¦  «         |                     ¦   «          d S # |                     ¦   «          w xY w)Nr<   Úxxx)r'   r   Ú_get_rc_fileÚassertFalser"   r$   ÚexistsÚ_store_pypircÚ
assertTrueÚopenÚreadrC   ÚWANTEDÚclose)r   rF   r&   ÚfÚcontents        r   Útest_server_empty_registrationz4PyPIRCCommandTestCase.test_server_empty_registrationm   sÔ   € Ø�iŠi˜œ	Ñ"Ô"ˆØ×ÒÑÔˆØ×Ò�œŸš¨Ñ+Ô+Ñ,Ô,Ð,Ø×Ò˜' 5Ñ)Ô)Ð)Ø�Š�œŸš rÑ*Ô*Ñ+Ô+Ð+Ý�‰HŒHˆð	Ø—f’f‘h”hˆGØ×Ò˜W¥fÑ-Ô-Ð-à�GŠG‰IŒIˆIˆIˆIøˆA�GŠG‰IŒIˆIˆIøøøs   Â9/C> Ã>Dc                 ó@  — |                       | j        t          ¦  «         |                      | j        ¦  «        }d|_        |                     ¦   «         }t          t          | 	                    ¦   «         ¦  «        ¦  «        }g d¢}|  
                    ||¦  «         d S )NÚserver3))r1   zyh^%#rest-of-my-passwordr3   r6   )r8   rY   )r:   Úcbiggles)r=   r&   r>   r'   r   r7   r?   r@   rA   rB   rC   rE   s       r   Útest_config_interpolationz/PyPIRCCommandTestCase.test_config_interpolationz   s’   € à�Š˜œ¥Ñ(Ô(Ð(Ø�iŠi˜œ	Ñ"Ô"ˆØ"ˆŒØ×!Ò!Ñ#Ô#ˆå•f˜VŸ\š\™^œ^Ñ,Ô,Ñ-Ô-ˆðCð Cð Cˆð 	×Ò˜ Ñ(Ô(Ð(Ð(Ð(r   N)r   r   r   rI   rW   r[   r   r   r   r.   r.   R   sA   € € € € € ð)ð )ð )ð2ð ð ð)ð )ð )ð )ð )r   r.   Ú__main__)Ú__doc__r"   ÚunittestÚdistutils.corer   r   Údistutils.logr   r   Údistutils.testsr   r>   rD   rS   ÚTempdirManagerÚLoggingSilencerÚEnvironGuardÚTestCaser	   r.   r   Úmainr   r   r   ú<module>rg      s  ðØ (Ð (Ø 	€	€	€	Ø €€€à (Ð (Ð (Ð (Ð (Ð (Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø Ð Ð Ð Ð Ð à #Ð #Ð #Ð #Ð #Ð #ð
€ð.€
ð
€ð:ð :ð :ð :ð : Ô 6Ø#Ô3Ø#Ô0Ø$Ô-ñ:ô :ð :ð<3)ð 3)ð 3)ð 3)ð 3)Ð5ñ 3)ô 3)ð 3)ðl ˆzÒÐØ€H„M�O„O€O€O€Oð Ðr   