Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_script_helper.cpython-310.pyc
o

�9j�@sxdZddlZddlZddlZddlmZddlZddlmZGdd�dej�Z	Gdd�dej�Z
ed	kr:e��dSdS)
zEUnittests for test.support.script_helper.  Who tests the test helper?�N)�
script_helper)�mockc@sPeZdZdd�Zdd�Zdd�Zdd�Ze�d	�d
d��Z	e�d	�dd
��Z
dS)�TestScriptHelpercCs"t�dd�}|�d|dd�dS)N�-c�import sys; sys.exit(0)rzreturn code was not 0)r�assert_python_ok�assertEqual)�self�t�r�./usr/lib/python3.10/test/test_script_helper.py�test_assert_python_ok
sz&TestScriptHelper.test_assert_python_okcCs$t�dd�\}}}|�d|d�dS)Nr�sys.exit(0)rzreturn code should not be 0)r�assert_python_failure�assertNotEqual)r	�rc�out�errrrr�test_assert_python_failuresz+TestScriptHelper.test_assert_python_failurecC�`|�t��}t�dd�Wd�n1swYt|j�}|�d|�|jd|dd�dS)Nrrz
command line:zunexpected command line��msg)�assertRaises�AssertionErrorrr�str�	exception�assertIn�r	�
error_context�	error_msgrrr�test_assert_python_ok_raisess�
z-TestScriptHelper.test_assert_python_ok_raisescCr)NrrzProcess return code is 0
zunexpected command line.r)rrrrrrrrrrr�!test_assert_python_failure_raisess�

�z2TestScriptHelper.test_assert_python_failure_raiseszsubprocess.PopencCs�tjjtddd��c}td�|_z	t�ddd�Wnty3}z|�d|jd�WYd}~nd}~ww|�d	|j	�|�d	|j	�|j
dd}|�tj|d�|�
d|�|�
d
|�|�d|�Wd�dS1sowYdS)N� interpreter_requires_environmentF��return_value�bail out of unittestTr�Noner��-I�-E)r�patch�objectr�RuntimeError�side_effect�_assert_pythonr�args�
call_count�	call_args�sys�
executabler�assertNotIn�r	�
mock_popen�
mock_ire_funcr�
popen_commandrrr�1test_assert_python_isolated_when_env_not_required&s(�
��"�zBTestScriptHelper.test_assert_python_isolated_when_env_not_requiredcCs�tjjtddd��F}td�|_z	t�ddd�Wnty3}z|�d|jd�WYd}~nd}~ww|j	dd}|�
d	|�|�
d
|�Wd�dS1sRwYdS)z>Ensure that -I is not passed when the environment is required.r"Tr#r%rr&rNr(r))rr*r+rr,r-r.rr/r1r4r5rrr�4test_assert_python_not_isolated_when_env_is_required8s �
��"�zETestScriptHelper.test_assert_python_not_isolated_when_env_is_requiredN)�__name__�
__module__�__qualname__r
rr r!rr*r9r:rrrrrs
rc@sheZdZdZdd�Zdd�Ze�d�dd��Ze�d�d	d
��Z	e�d�dd��Z
e�d�d
d��ZdS)�TestScriptHelperEnvironmentz5Code coverage for interpreter_requires_environment().cCs|�ttd��dtjd<dS�N�$__cached_interp_requires_environment)�
assertTrue�hasattrr�__dict__�r	rrr�setUpKs�z!TestScriptHelperEnvironment.setUpcCsdtjd<dSr?)rrCrDrrr�tearDownQsz$TestScriptHelperEnvironment.tearDownzsubprocess.check_callcCsztj�tj��,tj�dd�t�dd�|_|�	t
���|�	t
���|�d|j
�Wd�dS1s6wYdS)N�
PYTHONHOME�r')rr*�dict�os�environ�pop�
subprocess�CalledProcessErrorr-rArr"rr0�r	�mock_check_callrrr�*test_interpreter_requires_environment_trueUs"�zFTestScriptHelperEnvironment.test_interpreter_requires_environment_truecCsftj�tj��"tj�dd�t��|�t���|�	d|j
�Wd�dS1s,wYdS)NrGr')rr*rIrJrKrLrr"�assertFalserr0rOrrr�+test_interpreter_requires_environment_false^s"�zGTestScriptHelperEnvironment.test_interpreter_requires_environment_falsecCs�tj�tj��?tj�dd�t��|�t���|�t���|�	d|j
�|jdd}|�	tj
|d�|�d|�Wd�dS1sIwYdS)NrGr'rr))rr*rIrJrKrLrr"rRrr0r1r2r3r)r	rP�check_call_commandrrr�-test_interpreter_requires_environment_detailsgs"�zITestScriptHelperEnvironment.test_interpreter_requires_environment_detailscCshtj�tj��#dtjd<|�t���|�t���|�d|j	�Wd�dS1s-wYdS)N�
MockedHomerGr)
rr*rIrJrKrArr"rr0rOrrr�5test_interpreter_requires_environment_with_pythonhomess
"�zQTestScriptHelperEnvironment.test_interpreter_requires_environment_with_pythonhomeN)r;r<r=�__doc__rErFrr*rQrSrUrWrrrrr>Hs


r>�__main__)
rXrMr2rJ�test.supportr�unittestr�TestCaserr>r;�mainrrrr�<module>s=4�

Youez - 2016 - github.com/yon3zu
LinuXploit