Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/distutils/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/distutils/tests/__pycache__/test_install.cpython-38.pyc
U

@��gW!�@s�dZddlZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlmZ
ddlmZddl
mZddlmZdd	lmZdd
lmZddlmZddlmZdd
�ZGdd�dejejejej�Z dd�Z!e"dkr�ee!��dS)z$Tests for distutils.command.install.�N)�captured_stdout�run_unittest)�	sysconfig)�install)�	build_ext)�INSTALL_SCHEMES)�Distribution)�DistutilsOptionError)�	Extension)�supportcCs|t�d�S)NZ
EXT_SUFFIX)rZget_config_var)�modname�r
�;/opt/cppython/lib/python3.8/distutils/tests/test_install.py�_make_ext_namesrc@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�InstallTestCasecs���}tj�|d�}tddi�}tj�|d�|_tj|tj�|d�d�|jd<t	|�}||_
|����|j
|���|j|��fdd	�}tj�|dd
�}||j|�||j|�||j|�||jtj�|dd
d��||jtj�|d��||j|�dS)
NZinstallation�nameZfoopkgzsetup.py�lib)Z
build_baseZ	build_libZbuildcs(tj�|�}tj�|�}��||�dS�N)�os�path�normpath�assertEqual)Zgot�expected��selfr
r�
check_path6szAInstallTestCase.test_home_installation_scheme.<locals>.check_pathZpythonZinclude�bin)�mkdtemprr�joinrZscript_namerZDummyCommand�command_objr�home�ensure_finalizedr�install_baseZinstall_platbaseZinstall_libZinstall_platlibZinstall_purelibZinstall_headersZinstall_scriptsZinstall_data)rZbuilddirZdestination�dist�cmdrZlibdirr
rr�test_home_installation_scheme s.��z-InstallTestCase.test_home_installation_schemecsVtj�_tj�_����_tj�	�jd��_
tj�	�jd��_�j
t_�jt_�j
t_�jt_�fdd�}tjj
�_|tj_
�fdd�}��|�dD]}��|t�q�tdd	i�}t|�}d
d�|jD�}��d|�d
|_��tj��j
����tj��j��|����tj��j
����tj��j����d|j���d|j�dS)N�B�Scs�jSr)�tmpdir)rrr
r�_expanduserQsz3InstallTestCase.test_user_site.<locals>._expandusercs.�jt_�jt_�jt_�jt_�jtj_	dSr)
�
old_user_base�site�	USER_BASE�
old_user_site�	USER_SITE�install_module�
old_expandrr�
expanduserr
rr
r�cleanupVs
z/InstallTestCase.test_user_site.<locals>.cleanup)Znt_userZ	unix_userr�xxcSsg|]\}}}|�qSr
r
)�.0rZshortZlabler
r
r�
<listcomp>fsz2InstallTestCase.test_user_site.<locals>.<listcomp>�user��userbaseZusersite)r+r,r*r.r-rr(rrr�	user_base�	user_siter/r1r0Z
addCleanupZassertInrrrZuser_optionsr6ZassertFalse�existsr!Z
assertTrueZconfig_vars)rr)r2�keyr#r$�optionsr
rr�test_user_siteDs<


�zInstallTestCase.test_user_sitecCs�tddd��}t|�}|��|�|jddg�|�|jd�|�|jd�dg|_|��|�|jdg�|�|jd�|�|jd�d|_|_|��|�|jd�|�|jd�|�|jd�d|_|�t|j�dS)Nr3z	path,dirs)r�
extra_pathr�dirs�zpath,dirs,again)	rrZhandle_extra_pathrr?Z
extra_dirsZ	path_file�assertRaisesr	�rr#r$r
r
r�test_handle_extra_path{s$z&InstallTestCase.test_handle_extra_pathcCsftddi�}t|�}d|_d|_|�t|j�d|_d|_|�t|j�d|_d|_|�t|j�dS)Nrr3�prefix�baser r6)	rrrEr"rBr	Zfinalize_optionsr r6rCr
r
r�test_finalize_options�sz%InstallTestCase.test_finalize_optionsc	Cs�|��}|jdgdgd�\}}t�|�|�dd�|�dd�t|�}||jd<||_tj�	|d�|_
|��|��t
|j
�}z|��}W5|��Xd	d
�|��D�}ddtjjddtjdd
�g}|�||�dS)NZhelloZsayhi)Z
py_modulesZscriptszhello.pyzdef main(): print('o hai')zfrom hello import main; main()r�filelistcSsg|]}tj�|��qSr
�rr�basename�r4�liner
r
rr5�sz/InstallTestCase.test_record.<locals>.<listcomp>zhello.%s.pyc�UNKNOWN-0.0.0-py%s.%s.egg-info�)r�create_distr�chdirZ
write_filerr�rootrr�recordr!�run�open�close�read�
splitlines�sys�implementation�	cache_tag�version_infor)	r�install_dir�project_dirr#r$�f�content�foundrr
r
r�test_record�s.�




�zInstallTestCase.test_recordc
Cst��}|dk	r|�d|�|��}|jtddg�gd�\}}t�|�t�	|�t
|�}t�|�|��t
|�}||jd<||jd<||_tj�|d�|_|��|��t|j�}z|��}W5|��Xdd	�|��D�}td�d
tjdd�g}	|�||	�dS)NzThe %r command is not foundr3z
xxmodule.c)Zext_modulesrrrHcSsg|]}tj�|��qSr
rIrKr
r
rr5�sz:InstallTestCase.test_record_extensions.<locals>.<listcomp>rMrN)�test_supportZmissing_compiler_executableZskipTestrrOr
rrPrZcopy_xxmodule_crZfixup_build_extr!rrrQrrrRrSrTrUrVrWrrXr[r)
rr$r\r]r#Zbuildextcmdr^r_r`rr
r
r�test_record_extensions�s8
�






�z&InstallTestCase.test_record_extensionsc	CsNt|j�}dt_zt��|��W5QRXW5dt_X|�t|j�|�dS)NTF)�lenZlogsr/�DEBUGrraZ
assertGreater)rZold_logs_lenr
r
r�test_debug_mode�s
zInstallTestCase.test_debug_modeN)
�__name__�
__module__�__qualname__r%r>rDrGrarcrfr
r
r
rrs$7!rcCs
t�t�Sr)�unittestZ	makeSuiterr
r
r
r�
test_suite�srk�__main__)#�__doc__rrXrjr+Ztest.supportrrZ	distutilsrZdistutils.command.installrZdistutils.commandr/Zdistutils.command.build_extrrZdistutils.corerZdistutils.errorsr	Zdistutils.extensionr
Zdistutils.testsr�testrbrZTempdirManagerZEnvironGuardZLoggingSilencerZTestCaserrkrgr
r
r
r�<module>s2�Z

F1le Man4ger