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_spawn.cpython-310.opt-2.pyc
o

�i6�@s�	ddlZddlZddlZddlZddlmZmZddlmZddl	m
Z
ddl	mZddlm
Z
ddlmZGdd	�d	ejejej�Zd
d�ZedkrSee��dSdS)
�N)�run_unittest�
unix_shell)�	os_helper)�find_executable)�spawn)�DistutilsExecError)�supportc@s6eZdZe�ejdvd�dd��Zdd�Zdd�Z	d	S)
�
SpawnTestCase)�nt�posixzRuns only under posix or ntcCs�|��}tjdkrtj�|d�}|�|dt�n
tj�|d�}|�|d�t�|d�|�	t
t|g�tjdkrItj�|d�}|�|dt�n
tj�|d�}|�|d�t�|d�t|g�dS)	N�win32zfoo.shz#!%s
exit 1zfoo.batzexit 1i�z#!%s
exit 0zexit 0)�mkdtemp�sys�platform�os�path�joinZ
write_filer�chmod�assertRaisesrr)�selfZtmpdirZexe�r�7/usr/local/lib/python3.10/distutils/tests/test_spawn.py�
test_spawns

zSpawnTestCase.test_spawncCst�����}tj}|d}tj�||�}t|d��Wd�n1s$wYt�|tj	�t
||d�}|�||�tj
dkrMt
||d�}|�||�t�|��t
|�}|�||�Wd�n1sgwYd|}t
||d�}|�|�t���d}d|d<tjjd|d	d
��Gtj�d|��0t
|�}|�|�t�|��t
|�}|�||�Wd�n1s�wYWd�n1s�wYWd�n1s�wYWd�n1s�wYt���h}tj|d<tjjddd	d
��Itj�dd��1t
|�}|�|�t�|��t
|�}|�||�Wd�n	1�s+wYWd�n	1�s;wYWd�n	1�sKwYWd�n	1�s[wYt����}|�dd�tjjdtd	d��*tj�d|��t
|�}|�||�Wd�n	1�s�wYWd�n	1�s�wYtjjd|d	d
��*tj�dd��t
|�}|�||�Wd�n	1�s�wYWd�n	1�s�wYWd�n1�s�wYWd�dSWd�dS1�swYdS)
Nz.exe�wb)rrZ
dontexist_��PATHzdistutils.spawn.os.confstrT)Zreturn_value�createzdistutils.spawn.os.defpath)Zside_effectr)rZtemp_dirZTESTFNrrr�openr�stat�S_IXUSRrZassertEqualrrZ
change_cwdZassertIsNoneZEnvironmentVarGuard�unittestZmockZpatch�pathsep�pop�
ValueError)rZtmp_dirZprogram_noeextZprogram�filename�rvZdont_exist_program�envrrr�test_find_executable.s��
�

���
������

��
������
�����	����� ��=$�z"SpawnTestCase.test_find_executablecCsJ|�t��
}tdg�Wd�n1swY|�dt|j��dS)Nzdoes-not-existzcommand 'does-not-exist' failed)rrrZassertIn�str�	exception)r�ctxrrr�test_spawn_missing_exes�z$SpawnTestCase.test_spawn_missing_exeN)
�__name__�
__module__�__qualname__r Z
skipUnlessr�namerr'r+rrrrr	s�
Qr	cCs
t�t�S)N)r Z	makeSuiter	rrrr�
test_suite�s
r0�__main__)rrrZ
unittest.mockr Ztest.supportrrrZdistutils.spawnrrZdistutils.errorsrZdistutils.testsrZTempdirManagerZLoggingSilencerZTestCaser	r0r,rrrr�<module>s&�w�