Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_print.cpython-312.pyc

�

'Μg��	��ddlZddlZddlmZddlmZe�Zd�d�d�d�d�d	�d
�d�d�ZGd
�d�Z	Gd�dej�ZGd�dej�Ze
dk(rej�yy)�N)�StringIO)�supportc��t|�S�N��print��args�sep�end�files    �,/usr/local/lib/python3.12/test/test_print.py�<lambda>rs��U�D�\�c��t|d|i�S)Nr
rr	s    rrrs��U�t�%<��%<rc��t|d|i�S)Nrrr	s    rrr���U�T�%:�s�%:rc��t|||d��S)N)rr
rr	s    rrr�
��U��s��%Erc��t|d|i�S)Nrrr	s    rrrrrc��t|||d��S)N)rr
rr	s    rrrrrc��t|||d��S)N�rrrr	s    rrrs
��U�d�s��%Crc��t||||d��S)N�rrr
rr	s    rrrs��U��s��$�%Nr))FFF)FFT)FTF)FTT)TFF)TFT)TTF)TTTc��eZdZd�Zd�Zy)�ClassWith__str__c��||_yr��x��selfr s  r�__init__zClassWith__str__.__init__$s	����rc��|jSrr�r"s r�__str__zClassWith__str__.__str__'s���v�v�
rN)�__name__�
__module__�__qualname__r#r&�rrrr#s���rrc�*�eZdZdZeeefd�Zd�Zd�Zy)�	TestPrintz-Test correct operation of the print function.c���t|tu|tu|tuf}tj�5}|||||�ddd�|j	j�|�y#1swY�*xYwr)�dispatch�
NotDefinedr�captured_stdout�assertEqual�getvalue)r"�expectedr
rrr
�fn�ts        r�checkzTestPrint.check.sn���s�*�,��*�,��:�-�/�0���
$�
$�
&�!��t�S�#�t�$�'�	
�������x�0�'�
&�s�A(�(A1c�p��ttf�fd�	}|dd�|dd�|dd�|dd	�|d
d�|dd	d
��|ddd��|ddd��|dddd��|ddd
d��|ddd��|ddd��|dd�|ddd��|ddd��|dddd��|d td
�f�|d!td"�d#f��jttdd$���jttdd$���jt
tdd�%�y)&Nc����j||||��t�}�jd||||���j|j�|�y)Nr�r)r6rr1r2)r3r
rr�or"s     �rr zTestPrint.test_print.<locals>.x@sP���
�J�J�x��3�C�J�8��
�A��J�J�r�4�S�c��J�:�
���Q�Z�Z�\�8�4r�
r*�a
)�azNone
rz1 2
)��z1   2
)r>� r?z1*2
�*)rz1 s)r>�sr9)rza
b
)r=�bz1.01)g�?r>rz1*a*1.3+)r>r=g�������?�+za

b
)r<rCz+ +
)�r@rEza
 b
z*
zabc 1
�abcr>�)r
)r/r�assertRaises�	TypeErrorr�AttributeErrorr!s` r�
test_printzTestPrint.test_print?s8���",�*�	5�	
�$���	�%���	�(�G��	�'�6��	�)�[�!�	�'�6�s�#�	�%��r�"�	�(�J�D�)�	�&�(���+�	�*�m��#�6�	�*�l��-�	�+�(�c�2�	�)�\�"�	�)�\�t�,�	�)�\�t�,�	�)�\�t��6�	�%�"�3�'�)�*�	�)�&�u�-�q�1�2�	
���)�U�B�A��6����)�U�B�A��6����.�%��"��=rc�H�Gd�d�}|�}td|dd��td|dd��td|d	�
�|j|jd�|j|jd�Gd�d
�}|j	t
td|�d�
�y)Nc��eZdZd�Zd�Zd�Zy)�,TestPrint.test_print_flush.<locals>.filelikec� �d|_d|_y)Nr9r)�written�flushedr%s rr#z5TestPrint.test_print_flush.<locals>.filelike.__init__js��!��� ��rc�.�|xj|z
c_yr)rP�r"�strs  r�writez2TestPrint.test_print_flush.<locals>.filelike.writens������#�rc�.�|xjdz
c_y)Nr>)rQr%s r�flushz2TestPrint.test_print_flush.<locals>.filelike.flushqs������!�rN)r'r(r)r#rUrWr*rr�filelikerNis��
!�
$�
"rrXr>r9T)r
rrWr?rGF)r
rWz123
c��eZdZd�Zd�Zy)�+TestPrint.test_print_flush.<locals>.noflushc��yrr*rSs  rrUz1TestPrint.test_print_flush.<locals>.noflush.write}s��rc��t�r)�RuntimeErrorr%s rrWz1TestPrint.test_print_flush.<locals>.noflush.flush�s��"�"rN)r'r(r)rUrWr*rr�noflushrZ|s��
�
#rr^)rr1rPrQrHr])r"rX�fr^s    r�test_print_flushzTestPrint.test_print_flushgs���		"�		"�
�J��
�a�a�R�t�,�
�a�a�R�t�,�
�a�a�u�%�������G�,�������A�&�	#�	#�	
���,��q�w�y���MrN)r'r(r)�__doc__r/r6rKr`r*rrr,r,+s��7��*�:�1�"&>�PNrr,c�:�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�TestPy2MigrationHintzwTest that correct hint is produced analogous to Python3 syntax,
    if print statement is executed as in Python 2.
    c��d}|jt�5}t|�ddd�|jdt	j
��y#1swY�/xYw)Nzprint "Hello World"�?Missing parentheses in call to 'print'. Did you mean print(...)�rH�SyntaxError�exec�assertInrT�	exception�r"�python2_print_str�contexts   r�test_normal_stringz'TestPy2MigrationHint.test_normal_string��N��1��
�
�
�{�
+�w��"�#�,�	
�
�
�W��G�%�%�&�	(�,�
+���A�Ac��d}|jt�5}t|�ddd�|jdt	j
��y#1swY�/xYw)Nzprint "Hello World",rerfrks   r�test_string_with_soft_spacez0TestPy2MigrationHint.test_string_with_soft_space�sN��2��
�
�
�{�
+�w��"�#�,�	
�
�
�W��G�%�%�&�	(�,�
+�rpc��d}|jt�5}t|�ddd�|jdt	j
��y#1swY�/xYw)Nzprint  "Hello World", rerfrks   r�%test_string_with_excessive_whitespacez:TestPy2MigrationHint.test_string_with_excessive_whitespace�sN��4��
�
�
�{�
+�w��"�#�,�	
�
�
�W��G�%�%�&�	(�,�
+�rpc��d}|jt�5}t|�ddd�|jdt	j
��y#1swY�/xYw)Nz.if 1:
            print "Hello World"
        rerfrks   r�#test_string_with_leading_whitespacez8TestPy2MigrationHint.test_string_with_leading_whitespace�sR�����
�
�{�
+�w��"�#�,�	
�
�
�W��G�%�%�&�	(�,�
+�rpc��d}|jt�5}t|�ddd�|jdt	j
��y#1swY�/xYw)Nzprint p;rerfrks   r�test_string_with_semicolonz/TestPy2MigrationHint.test_string_with_semicolon�sN��&��
�
�
�{�
+�w��"�#�,�	
�
�
�W��G�%�%�&�	(�,�
+�rpc��d}|jt�5}t|�ddd�|jdt	j
��y#1swY�/xYw)Nzfor i in s: print irerfrks   r� test_string_in_loop_on_same_linez5TestPy2MigrationHint.test_string_in_loop_on_same_line�rorpc�p�|jt�5}ttjz	dfddd�|jdt
j��|jt�5}tdz	ddd�|jdt
|j��|jt�5}ttjz	ddd�|jdt
|j��|jt�5}ttjzddd�|jdt
|j��Gd�d�}|jt|�z	d�y#1swY��XxYw#1swY��xYw#1swY��xYw#1swY�}xYw)N�messagez6Did you mean "print(<message>, file=<output_stream>)"?�*z
Did you mean zDid you meanc��eZdZd�Zy)�\TestPy2MigrationHint.test_stream_redirection_hint_for_py2_migration.<locals>.OverrideRRShiftc��y)Nr}r*)r"�lhss  r�__rrshift__zhTestPy2MigrationHint.test_stream_redirection_hint_for_py2_migration.<locals>.OverrideRRShift.__rrshift__�s��rN)r'r(r)r�r*rr�OverrideRRShiftr�s��
rr�)rHrIr�sys�stderrrirTrj�max�assertNotInr1)r"rmr�s   r�.test_stream_redirection_hint_for_py2_migrationzCTestPy2MigrationHint.test_stream_redirection_hint_for_py2_migration�sJ��
�
�
�y�
)�W��S�Z�Z���*�*��
�
�*�+.�w�/@�/@�+A�	C�
�
�
�y�
)�W��R�K�*��
�
�*�+.�w�/@�/@�+A�	C��
�
�y�
)�W��3�:�:��*�����#�g�.?�.?�*@�A��
�
�y�
)�W��S�Z�Z��*������W�->�->�)?�@�	�	�	
����/�"3�3�R�8�7*�
)��*�
)��*�
)��
*�
)�s/�F�2
F�>F �F,�F�F� F)�,F5N)r'r(r)rarnrrrtrvrxrzr�r*rrrcrc�s*���(�(�(�(�(�(�9rrc�__main__)�unittestr��ior�testr�objectr/r.r�TestCaser,rcr'�mainr*rr�<module>r�s����
���
�X�
�	2�<�:�E�:�E�C�N�!��*��WN��!�!�WN�tW9�8�,�,�W9�v�z���H�M�M�O�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists