Your IP : 216.73.216.60


Current Path : /opt/alt/python35/lib64/python3.5/test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/test/__pycache__/test_print.cpython-35.opt-2.pyc



���]��@s�ddlZddlmZddlmZe�Zddd�ddd�dd	d�dd
d�ddd�ddd�dd
d�ddd�iZGdd�d�ZGdd�dej	�Z
edkr�ej�dS)�N)�StringIO)�supportFcCs
t|�S)N)�print)�args�sep�end�file�r	�//opt/alt/python35/lib64/python3.5/test_print.py�<lambda>srTcCst|d|�S)Nr)r)rrrrr	r	r
rscCst|d|�S)Nr)r)rrrrr	r	r
rscCst|d|d|�S)Nrr)r)rrrrr	r	r
rscCst|d|�S)Nr)r)rrrrr	r	r
rscCst|d|d|�S)Nrr)r)rrrrr	r	r
rscCst|d|d|�S)Nrr)r)rrrrr	r	r
rscCst|d|d|d|�S)Nrrr)r)rrrrr	r	r
rsc@s(eZdZdd�Zdd�ZdS)�ClassWith__str__cCs
||_dS)N)�x)�selfr
r	r	r
�__init__#szClassWith__str__.__init__cCs|jS)N)r
)rr	r	r
�__str__&szClassWith__str__.__str__N)�__name__�
__module__�__qualname__rrr	r	r	r
r"src@s=eZdZeeedd�Zdd�Zdd�ZdS)�	TestPrintcCsht|tk	|tk	|tk	f}tj��}|||||�WdQRX|j|j�|�dS)N)�dispatch�
NotDefinedrZcaptured_stdout�assertEqual�getvalue)r�expectedrrrr�fn�tr	r	r
�check-s	zTestPrint.checkcs�tt�fdd�}|df�|dd#�|dd$�|dd%�|d
d&�|dd'd
d�|dd(dd�|dd)d
d�|dd*d
ddd�|dd+d
ddd�|dd,d
d�|dd-d
d�|dd.�|dd/d
d�|dd0dd�|dd1d
ddd�|dtd�f�|dtd �df��jttdd
d!��jttddd!��jttdd"d�dS)2Nc	sa�j||d|d|�t�}�jd|d|d|d|��j|j�|�dS)Nrr�r)rrrr)rrrr�o)rr	r
r
?s	"zTestPrint.test_print.<locals>.x�
�a
�azNone
z1 2
��z1   2
� z1*2
r�*z1 s�srrza
b
�bz1.01��?z1*a*1.3+��������?�+za

b
z+ +
�za
 b
z*
zabc 1
�abc�r)r!)N)r"r#)r"r$r#)r"r#)r"r&)r!r')r(r")r"r!r))r r')r+r$r+)r r')r r')r r')r r')rr�assertRaises�	TypeErrorr�AttributeError)rr
r	)rr
�
test_print>s,






zTestPrint.test_printcCs�Gdd�d�}|�}tdd|dddd�td	d|dddd�td
d|dd�|j|jd�|j|jd	�Gd
d�d�}|jttdd|�dd�dS)Nc@s4eZdZdd�Zdd�Zdd�ZdS)z,TestPrint.test_print_flush.<locals>.filelikecSsd|_d|_dS)Nrr)�written�flushed)rr	r	r
ris	z5TestPrint.test_print_flush.<locals>.filelike.__init__cSs|j|7_dS)N)r2)r�strr	r	r
�writemsz2TestPrint.test_print_flush.<locals>.filelike.writecSs|jd7_dS)Nr")r3)rr	r	r
�flushpsz2TestPrint.test_print_flush.<locals>.filelike.flushN)rrrrr5r6r	r	r	r
�filelikehsr7r"rrrr6Tr#r-Fz123
c@s(eZdZdd�Zdd�ZdS)z+TestPrint.test_print_flush.<locals>.noflushcSsdS)Nr	)rr4r	r	r
r5|sz1TestPrint.test_print_flush.<locals>.noflush.writecSs
t�dS)N)�RuntimeError)rr	r	r
r6sz1TestPrint.test_print_flush.<locals>.noflush.flushN)rrrr5r6r	r	r	r
�noflush{sr9)rrr2r3r.r8)rr7�fr9r	r	r
�test_print_flushfs	zTestPrint.test_print_flushN)rrrrrr1r;r	r	r	r
r*s(r�__main__)FFF)FFT)FTF)FTT)TFF)TFT)TTF)TTT)
Zunittest�iorZtestr�objectrrrZTestCaserr�mainr	r	r	r
�<module>s.								Y