Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_print.cpython-39.opt-2.pyc

a

��g{�	@s�ddlZddlZddlmZddlmZe�Zdd�dd�dd�dd�d	d�d
d�dd�dd�d
�ZGdd�d�Z	Gdd�dej
�ZGdd�dej
�Ze
dkr�e��dS)�N)�StringIO)�supportcCst|�S�N��print��args�sep�end�file�r�+/usr/local/lib/python3.9/test/test_print.py�<lambda>�rcCst|d|i�S)Nrrrrrr
rrcCst|d|i�S)Nr
rrrrr
rrcCst|||d��S)N)r
rrrrrr
rrcCst|d|i�S)Nr	rrrrr
rrcCst|||d��S)N)r	rrrrrr
rrcCst|||d��S)N�r	r
rrrrr
rrcCst||||d��S)N�r	r
rrrrrr
rr))FFF)FFT)FTF)FTT)TFF)TFT)TTF)TTTc@seZdZdd�Zdd�ZdS)�ClassWith__str__cCs
||_dSr��x��selfrrrr
�__init__$szClassWith__str__.__init__cCs|jSrr�rrrr
�__str__'szClassWith__str__.__str__N)�__name__�
__module__�__qualname__rrrrrr
r#src@s,eZdZeeefdd�Zdd�Zdd�ZdS)�	TestPrintcCsdt|tu|tu|tuf}t���}|||||�Wd�n1sF0Y|�|��|�dSr)�dispatch�
NotDefinedrZcaptured_stdout�assertEqual�getvalue)r�expectedrr	r
r�fn�trrr
�check.s�
,zTestPrint.checkcs<ttf�fdd�	}|dd�|dd�|dd�|d	d
�|dd�|d
d
dd�|dddd�|dddd�|ddddd�|ddddd�|dddd�|dddd�|d d�|d ddd�|d ddd�|d dddd�|d!td�f�|d"td#�d$f��jttdd%d��jttdd%d��jttddd&�dS)'Ncs@�j||||d�t�}�jd||||d���|��|�dS)Nr�r)r%rr r!)r"rr	r
�orrr
r@szTestPrint.test_print.<locals>.x�
r�a
)�azNone
rz1 2
)��z1   2
)r+� r,z1*2
�*)r	z1 s)r+�sr&)r
za
b
)r*�bz1.01)g�?r+rz1*a*1.3+)r+r*g�������?�+za

b
)r)r0z+ +
)�r-r2za
 b
z*
zabc 1
�abcr+�)r)rr�assertRaises�	TypeErrorr�AttributeErrorrrrr
�
test_print?s,





zTestPrint.test_printcCs�Gdd�d�}|�}td|ddd�td|ddd�td|d	d
�|�|jd�|�|jd�Gdd
�d
�}|jttd|�dd
�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z,TestPrint.test_print_flush.<locals>.filelikecSsd|_d|_dS)Nr&r)�written�flushedrrrr
rjsz5TestPrint.test_print_flush.<locals>.filelike.__init__cSs|j|7_dSr)r9�r�strrrr
�writensz2TestPrint.test_print_flush.<locals>.filelike.writecSs|jd7_dS)Nr+)r:rrrr
�flushqsz2TestPrint.test_print_flush.<locals>.filelike.flushN)rrrrr=r>rrrr
�filelikeisr?r+r&T)rr
r>r,r4F)rr>z123
c@seZdZdd�Zdd�ZdS)z+TestPrint.test_print_flush.<locals>.noflushcSsdSrrr;rrr
r=}sz1TestPrint.test_print_flush.<locals>.noflush.writecSst�dSr)�RuntimeErrorrrrr
r>�sz1TestPrint.test_print_flush.<locals>.noflush.flushN)rrrr=r>rrrr
�noflush|srA)rr r9r:r5r@)rr?�frArrr
�test_print_flushgszTestPrint.test_print_flushN)rrrrr%r8rCrrrr
r+s�
(rc@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�TestPy2MigrationHintcCsLd}|�t��}t|�Wd�n1s,0Y|�dt|j��dS)Nzprint "Hello World"�print("Hello World")�r5�SyntaxError�exec�assertInr<�	exception�rZpython2_print_str�contextrrr
�test_normal_string�s&z'TestPy2MigrationHint.test_normal_stringcCsLd}|�t��}t|�Wd�n1s,0Y|�dt|j��dS)Nzprint "Hello World",�print("Hello World", end=" ")rFrKrrr
�test_string_with_soft_space�s&z0TestPy2MigrationHint.test_string_with_soft_spacecCsLd}|�t��}t|�Wd�n1s,0Y|�dt|j��dS)Nzprint  "Hello World", rNrFrKrrr
�%test_string_with_excessive_whitespace�s&z:TestPy2MigrationHint.test_string_with_excessive_whitespacecCsLd}|�t��}t|�Wd�n1s,0Y|�dt|j��dS)Nz.if 1:
            print "Hello World"
        rErFrKrrr
�#test_string_with_leading_whitespace�s&z8TestPy2MigrationHint.test_string_with_leading_whitespacecCsLd}|�t��}t|�Wd�n1s,0Y|�dt|j��dS)Nzprint p;zprint(p)rFrKrrr
�test_string_with_semicolon�s&z/TestPy2MigrationHint.test_string_with_semicoloncCsLd}|�t��}t|�Wd�n1s,0Y|�dt|j��dS)Nzfor i in s: print izprint(i)rFrKrrr
� test_string_in_loop_on_same_line�s&z5TestPy2MigrationHint.test_string_in_loop_on_same_linecCs>|�t��}ttj?dfWd�n1s.0Y|�dt|j��|�t��}td?Wd�n1sr0Y|�dt|j��|�t��}ttj?Wd�n1s�0Y|�	dt|j��|�t��}ttj>Wd�n1s�0Y|�	dt|j��Gdd�d�}|�
t|�?d�dS)N�messagez6Did you mean "print(<message>, file=<output_stream>)"?�*z
Did you mean zDid you meanc@seZdZdd�ZdS)z\TestPy2MigrationHint.test_stream_redirection_hint_for_py2_migration.<locals>.OverrideRRShiftcSsdS)NrUr)rZlhsrrr
�__rrshift__�szhTestPy2MigrationHint.test_stream_redirection_hint_for_py2_migration.<locals>.OverrideRRShift.__rrshift__N)rrrrVrrrr
�OverrideRRShift�srW)r5r6r�sys�stderrrIr<rJ�maxZassertNotInr )rrLrWrrr
�.test_stream_redirection_hint_for_py2_migration�s$,�&�((zCTestPy2MigrationHint.test_stream_redirection_hint_for_py2_migrationN)
rrrrMrOrPrQrRrSr[rrrr
rD�srD�__main__)ZunittestrX�ior�testr�objectrrrZTestCaserrDr�mainrrrr
�<module>s$	�ZU

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