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.7/distutils/tests/__pycache__/test_spawn.cpython-37.opt-2.pyc
B

!��g"�@s�ddlZddlZddlZddlZddlmZddlmZmZddlm	Z
ddlmZddlm
Z
ddlmZddlmZddlm	Z	Gd	d
�d
e	je	jej�Zdd�Zed
kr�ee��dS)�N)�mock)�run_unittest�
unix_shell)�support)�find_executable)�_nt_quote_args)�spawn)�DistutilsExecErrorc@s6eZdZdd�Ze�ejdkd�dd��Zdd�Z	d	S)
�
SpawnTestCasecCsFx@ddgddgfddgddgffD]\}}t|�}|�||�q"WdS)Nz
with spaceZnospacez"with space"Znochange)r�assertEqual)�self�argsZwantedZres�r�6/usr/local/lib/python3.7/distutils/tests/test_spawn.py�test_nt_quote_argssz SpawnTestCase.test_nt_quote_args)�nt�posixzRuns only under posix or ntcCs�|��}tjdkr2tj�|d�}|�|dt�ntj�|d�}|�|d�t�|d�|�	t
t|g�tjdkr�tj�|d�}|�|dt�ntj�|d�}|�|d�t�|d�t|g�dS)	N�win32zfoo.shz#!%s
exit 1zfoo.batzexit 1i�z#!%s
exit 0zexit 0)Zmkdtemp�sys�platform�os�path�joinZ
write_filer�chmodZassertRaisesr	r)rZtmpdirZexerrr�
test_spawns

zSpawnTestCase.test_spawnc
Cs�t�����}tj}|d}tj�||�}t|d��WdQRXt�|tj	�t
||d�}|�||�tj
dkr�t
||d�}|�||�t�|��t
|�}|�||�WdQRXd|}t
||d�}|�|�t����}d|d<tjjd|d	d
��\tj�d|��Bt
|�}|�|�t�|��t
|�}|�||�WdQRXWdQRXWdQRXWdQRXt����}tj|d<tjjddd	d
��\tj�dd��Bt
|�}|�|�t�|��t
|�}|�||�WdQRXWdQRXWdQRXWdQRXt����}|�dd�tjjdtd	d��4tj�d|��t
|�}|�||�WdQRXWdQRXtjjd|d	d
��4tj�dd��t
|�}|�||�WdQRXWdQRXWdQRXWdQRXdS)
Nz.exe�wb)rrZ
dontexist_��PATHzdistutils.spawn.os.confstrT)Zreturn_value�createzdistutils.spawn.os.defpath)Zside_effectr)�test_supportZtemp_dirZTESTFNrrr�openr�stat�S_IXUSRrrrrZ
change_cwdZassertIsNoneZEnvironmentVarGuard�unittestrZpatch�pathsep�pop�
ValueError)rZtmp_dirZprogram_noeextZprogram�filename�rvZdont_exist_program�envrrr�test_find_executable:sj




4


4

 z"SpawnTestCase.test_find_executableN)
�__name__�
__module__�__qualname__rr#Z
skipUnlessr�namerr*rrrrr
s
r
cCs
t�t�S)N)r#Z	makeSuiter
rrrr�
test_suite�sr/�__main__)rr!rr#rZtest.supportrrZtestrrZdistutils.spawnrrrZdistutils.errorsr	Zdistutils.testsZTempdirManagerZLoggingSilencerZTestCaser
r/r+rrrr�<module>s"z