403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.25
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 :  /lib/python3/dist-packages/IPython/terminal/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/IPython/terminal/tests/__pycache__/test_interactivshell.cpython-311.pyc
�

�@�cE���dZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
Gd�dej��ZGd	�d
ej��ZGd�de��Zd
�ZGd�dej��Zd�ZGd�dej��ZdS)z:Tests for the TerminalInteractiveShell and related pieces.�N)�InputTransformer)�tools)�capture_output)�_elide�(_adjust_completion_text_based_on_contextc�&�eZdZd�Zd�Zd�Zd�ZdS)�	TestElidec�b�tdd��tdd��|�tdd��d��tj�gd���}tjdzdzd	ztjzd
z}|�t|d��|��dS)Nzconcatenate((a1, a2, ...), axis�z concatenate((a1, a2, ..), . axisz0aaaa.bbbb.ccccc.dddddd.eeeee.fffff.gggggg.hhhhhhuaaaa.b…g.hhhhhh)r�
aaaaaaaaaa�
bbbbbbbbbb�
ccccccccccr�au…�br)r�assertEqual�os�sep�join)�self�test_string�
expect_stirngs   �M/usr/lib/python3/dist-packages/IPython/terminal/tests/test_interactivshell.py�
test_elidezTestElide.test_elides����0�"�5�5�5��1�2�6�6�6�����E�r�J�J��	
�	
�	
�
�f�k�k�"H�"H�"H�I�I���F�S�L�4�4�s�:�R�V�C�h�N�	�	
�����R�0�0�-�@�@�@�@�@�c�R�|�tddd���d��dS)N�,the quick brown fox jumped over the lazy dogzthe quick brown fox�
��	min_elideu"the…fox jumped over the lazy dog�rr�rs r�test_elide_typed_normalz!TestElide.test_elide_typed_normal sD������>�%��
�
�
�

1�
	
�	
�	
�	
�	
rc�R�|�tddd���d��dS)�Y
        if the match is too short we don't elide.
        avoid the "the...the"
        r�therrNr r!s r�test_elide_typed_short_matchz&TestElide.test_elide_typed_short_match*s=��
	
����A�5�TV�W�W�W�:�	
�	
�	
�	
�	
rc�R�|�tddd���d��dS)r$rzthe quick red foxrrNr r!s r�test_elide_typed_no_matchz#TestElide.test_elide_typed_no_match4sF��	
����>�#��
�
�
�

;�
	
�	
�	
�	
�	
rN)�__name__�
__module__�__qualname__rr"r&r(�rrr	r	sS������A�A�A�
�
�
�
�
�
�

�

�

�

�

rr	c��eZdZd�ZdS)�TestContextAwareCompletionc�x�|�tddd��d��|�tddd��d��|�tddd��d��|�tddd��d��|�tddd��d��dS)	Nzarg1=z	func1(a=)��arg1zfunc1(a)zfunc1(az%magic�func2)rrr!s r�,test_adjust_completion_text_based_on_contextzGTestContextAwareCompletion.test_adjust_completion_text_based_on_contextEs������4�W�k�1�M�M�v�	
�	
�	
�
	
���4�W�j�!�L�L�g�	
�	
�	
�	
���4�W�i��K�K�W�	
�	
�	
�	
���4�X�{�A�N�N�PX�	
�	
�	
�	
���4�W�k�1�M�M�w�	
�	
�	
�	
�	
rN)r)r*r+r3r,rrr.r.Ds#������
�
�
�
�
rr.c�*�eZdZdZd�Zd�Zd�Zd�ZdS)�mock_input_helperzZMachinery for tests of the main interact loop.

    Used by the mock_input decorator.
    c�H�||_d|_t��|_dS�N)�testgen�	exception�get_ipython�ip)rr8s  r�__init__zmock_input_helper.__init__bs���������-�-����rc�J�|jj|_|j|j_|Sr7)r;�prompt_for_code�orig_prompt_for_code�
fake_inputr!s r�	__enter__zmock_input_helper.__enter__gs ��$(�G�$;��!�"&�/�����rc�(�|j|j_dSr7)r?r;r>)r�etype�value�tbs    r�__exit__zmock_input_helper.__exit__ls��"&�";�����rc��	t|j��S#t$rd|j_YdStj��|_d|j_YdSxYw)NFr)�nextr8�
StopIterationr;�keep_running�sys�exc_infor9r!s rr@zmock_input_helper.fake_inputosa��	����%�%�%���	�	�	�#(�D�G� ��3�3�	� �\�^�^�D�N�#(�D�G� ��3�3���s��A�%AN)r)r*r+�__doc__r<rArFr@r,rrr5r5]sZ�������� � � �
���
<�<�<�	�	�	�	�	rr5c����fd�}|S)z�Decorator for tests of the main interact loop.

    Write the test as a generator, yield-ing the input strings, which IPython
    will see as if they were typed in at the prompt.
    c����|��}t|��5}|j���ddd��n#1swxYwY|j�3|j\}}}ddl}|�|tj���~|�dS)Nr)�file)r5r;�interactr9�	traceback�print_tbrK�stdout)rr8�mihrCrDrErR�testfuncs       �r�test_methodzmock_input.<locals>.test_method�s�����(�4�.�.��
�w�
'�
'�	�3��F�O�O����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��=�$�"�}��E�5�"��������r��
��3�3�3���K�
%�$s�A�A�	Ar,)rVrWs` r�
mock_inputrXzs$���������rc�0�eZdZd�Zed���Zd�ZdS)�InteractiveShellTestCasec�D���fd�t|dz
dd��D��S)z-Get last n readline history entries as a listc�d��g|],}������|z
����-Sr,)�get_history_item�get_current_history_length)�.0�x�rls  �r�
<listcomp>z<InteractiveShellTestCase.rl_hist_entries.<locals>.<listcomp>�sH���/�/�/���#�#�B�$A�$A�$C�$C�a�$G�H�H�/�/�/r����)�range)rra�ns ` r�rl_hist_entriesz(InteractiveShellTestCase.rl_hist_entries�s>���/�/�/�/��q�1�u�b�"�-�-�/�/�/�	/rc#�K�t��}|j�t��	t	jdd���5dV�ddd��n#1swxYwYt	jdd���5dV�ddd��n#1swxYwYt	jdd���5dV�ddd��n#1swxYwY|j�t��dS#|j�t��wxYw)	N�4F)�suppressz
print(2*2)zSyntaxError: input containszprint(2345) # syntaxerror�16z
print(4*4))r:�input_transformers_post�append�syntax_error_transformer�tt�AssertPrints�remove)rr;s  r�!test_inputtransformer_syntaxerrorz:InteractiveShellTestCase.test_inputtransformer_syntaxerror�s�����
�]�]��
�"�)�)�*B�C�C�C�	H����u�5�5�5�
$�
$�#�#�#�#�
$�
$�
$�
$�
$�
$�
$�
$�
$�
$�
$����
$�
$�
$�
$���!>��O�O�O�
3�
3�2�2�2�2�
3�
3�
3�
3�
3�
3�
3�
3�
3�
3�
3����
3�
3�
3�
3�����6�6�6�
$�
$�#�#�#�#�
$�
$�
$�
$�
$�
$�
$�
$�
$�
$�
$����
$�
$�
$�
$�
�&�-�-�.F�G�G�G�G�G��B�&�-�-�.F�G�G�G�G���sw�C(�A�C(�A�C(�A� C(�9B
�>C(�
B�C(�B�C(�+B<�0C(�<C�C(�C�C(�(!D	c��	�t��}|j}|jdgksJ�|jjsJ�Gd�dt
��}|��}|�|��\}}|�|dt|��i��Gd�d|��}d�	�	fd�}|jj�	d��d	|jj
d_||jd<	|��}t|��d|jj
d_|jd=n$#d|jj
d_|jd=wxYw�	d	ksJ�dS)
Nz
text/plainc��eZdZd�Zd�ZdS)�?InteractiveShellTestCase.test_repl_not_plain_text.<locals>.Testc�&�dt|��zS)Nz	<Test %i>)�idr!s r�__repr__zHInteractiveShellTestCase.test_repl_not_plain_text.<locals>.Test.__repr__�s��"�R��X�X�-�-rc��dS)Nz<html>r,r!s r�_repr_html_zKInteractiveShellTestCase.test_repl_not_plain_text.<locals>.Test._repr_html_�s���xrN)r)r*r+rxrzr,rr�Testru�s2������
.�
.�
.�
 �
 �
 �
 �
 rr{c��eZdZd�ZdS)�@InteractiveShellTestCase.test_repl_not_plain_text.<locals>.Test2c�>�ddlm}m}||d����dS)Nr)�display�HTMLz<custom>)�IPython.displayrr�)rrr�s   r�_ipython_display_zRInteractiveShellTestCase.test_repl_not_plain_text.<locals>.Test2._ipython_display_�s:��9�9�9�9�9�9�9�9�����Z�(�(�)�)�)�)�)rN)r)r*r+r�r,rr�Test2r}�s#������
*�
*�
*�
*�
*rr�Fc�*��td��d�dS)NzHandler calledT)�print)�data�metadata�calleds  �r�handlerzBInteractiveShellTestCase.test_repl_not_plain_text.<locals>.handler�s����"�#�#�#��F�F�Frz	text/htmlT)
r:�display_formatter�active_types�ipython_display_formatter�enabled�object�formatr�reprrm�
formatters�mime_renderersr)
rr;�	formatterr{�objr��_r�r�r�s
         @r�test_repl_not_plain_textz1InteractiveShellTestCase.test_repl_not_plain_text�s����
�]�]���(�	��%�,��7�7�7�7��2�:�:�:�:�	 �	 �	 �	 �	 �6�	 �	 �	 ��d�f�f���"�"�3�'�'���a������d�3�i�i�8�9�9�9�	*�	*�	*�	*�	*�D�	*�	*�	*���	�	�	�	�	�
	��)�0�0��=�=�=�?C���'��4�<�)0���+�&�	/��$�&�&�C��C�L�L�L�CH�B� �+�K�8�@��!�+�.�.��DI�B� �+�K�8�@��!�+�.�.�.�.�.���~�~�~�~�~�~s�#D�!D=N)r)r*r+rgrXrrr�r,rrrZrZ�sP������/�/�/�
�H�H��Z�H�$-�-�-�-�-rrZc��|D]?}|�d��}|dkr"td��}||_|dz|_|��@|S)zDTransformer that throws SyntaxError if 'syntaxerror' is in the code.�syntaxerrorrzinput contains "syntaxerror"rc)�find�SyntaxError�text�offset)�lines�line�pos�es    rrnrn�s\�������i�i�
�&�&���!�8�8��:�;�;�A��A�F��Q�w�A�H��G�	�
�Lrc��eZdZd�ZdS)�TerminalMagicsTestCasec���t��}d}|jjd}|�|d���|�|jdd��d��dS)z=Test that code with a blank line doesn't get split (gh-3246).z-def pasted_func(a):
    b = a+1

    return b�TerminalMagicsN)�name�pasted_func�6�7)r:�magics_manager�registry�store_or_executer�user_ns)rr;�s�tms    r�test_paste_magics_blanklinez2TerminalMagicsTestCase.test_paste_magics_blankline�sl��
�]�]����
�
�
'�(8�
9��
���A�D��)�)�)����2���M�2�2�6�6��;�;�;�;�;rN)r)r*r+r�r,rrr�r��s#������<�<�<�<�<rr�)rMrK�unittestr�IPython.core.inputtransformerr�IPython.testingrro�IPython.utils.capturer�IPython.terminal.ptutilsrr�TestCaser	r.r�r5rXrZrnr�r,rr�<module>r�s���@�@��
�
�
�����	�	�	�	�:�:�:�:�:�:�'�'�'�'�'�'�0�0�0�0�0�0�U�U�U�U�U�U�U�U�0
�0
�0
�0
�0
��!�0
�0
�0
�f
�
�
�
�
��!2�
�
�
�2���������:���.F�F�F�F�F�x�0�F�F�F�R	�	�	�<�<�<�<�<�X�.�<�<�<�<�<r

Youez - 2016 - github.com/yon3zu
LinuXploit