Your IP : 216.73.216.213


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



��Yf
{�@s�dZddlZddlZddlZddlZddlZddlZddlZddlmZyddl	Z	Wne
k
r�dZ	YnXddlZddlmZGdd�dej
�Zedkr�ej�dS)zTests for streams.py.�N)�mock)�
test_utilscs�eZdZdZ�fdd�Z�fdd�Zejd�dd��Zd	d
�Z	dd�Z
eje
ed
�d�dd��Zdd�Zejedkd�dd��Zejedkd�eje
ed
�d�dd���Zdd�Zdd�Zeje
ed
�d�dd��Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Z d1d2�Z!d3d4�Z"d5d6�Z#d7d8�Z$d9d:�Z%d;d<�Z&d=d>�Z'd?d@�Z(dAdB�Z)dCdD�Z*dEdF�Z+dGdH�Z,dIdJ�Z-dKdL�Z.dMdN�Z/dOdP�Z0dQdR�Z1dSdT�Z2dUdV�Z3dWdX�Z4dYdZ�Z5d[d\�Z6d]d^�Z7d_d`�Z8eje
ed
�d�dadb��Z9eje:j;dckdd�dedf��Z<dgdh�Z=didj�Z>dkdl�Z?dmdn�Z@dodp�ZAdqdr�ZBdsdt�ZCdudv�ZDdwdx�ZEdydz�ZF�S){�StreamReaderTestssline1
line2
line3
cs0t�j�tj�|_|j|j�dS)N)�super�setUp�asyncioZnew_event_loop�loop�set_event_loop)�self)�	__class__��C/opt/alt/python35/lib64/python3.5/test/test_asyncio/test_streams.pyrs
zStreamReaderTests.setUpcs8tj|j�|jj�tj�t�j�dS)N)r�run_brieflyr�close�gcZcollectr�tearDown)r
)rrr
rs

zStreamReaderTests.tearDownzasyncio.streams.eventscCs)tj�}|j|j|jj�dS)N)r�StreamReader�assertIs�_loopZget_event_loop�return_value)r
Zm_events�streamrrr
�test_ctor_global_loop%sz'StreamReaderTests.test_ctor_global_loopcCs�|jj|�\}}|jd�|j�}|jj|�}|j|d�|j�}|jj|�}|j|jd��|j�dS)NsGET / HTTP/1.0

sHTTP/1.0 200 OK
s

Test message)	r�run_until_complete�write�readline�assertEqual�read�
assertTrue�endswithr)r
�open_connection_fut�reader�writer�f�datarrr
�_basetest_open_connection*s
z+StreamReaderTests._basetest_open_connectioncCsBtj��/}tj|jd|j�}|j|�WdQRXdS)Nr)r�run_test_serverr�open_connection�addressrr$)r
�httpd�conn_futrrr
�test_open_connection5sz&StreamReaderTests.test_open_connectionZAF_UNIXzNo UNIX SocketscCsBtj��/}tj|jd|j�}|j|�WdQRXdS)Nr)r�run_test_unix_serverr�open_unix_connectionr'rr$)r
r(r)rrr
�test_open_unix_connection;sz+StreamReaderTests.test_open_unix_connectioncCs|z|jj|�\}}Wdtjd�X|jd�|j�}|jj|�}|j|jd��|j�dS)NsGET / HTTP/1.0

s

Test message)	rrrr	rrrrr)r
rr r!r"r#rrr
�%_basetest_open_connection_no_loop_sslBs
z7StreamReaderTests._basetest_open_connection_no_loop_sslNz
No ssl modulec
CsTtjdd��;}tj|jdtj�d|j�}|j|�WdQRXdS)N�use_sslT�sslr)rr%rr&r'�dummy_ssl_contextrr.)r
r(r)rrr
� test_open_connection_no_loop_sslNs	z2StreamReaderTests.test_open_connection_no_loop_sslcCsZtjdd��A}tj|jdtj�ddd|j�}|j|�WdQRXdS)Nr/Tr0Zserver_hostname�r)rr+rr,r'r1rr.)r
r(r)rrr
�%test_open_unix_connection_no_loop_sslXs	z7StreamReaderTests.test_open_unix_connection_no_loop_sslc	Cs||jj|�\}}|jjt��|j�}|jt��|jj|�WdQRX|j�tj	|j�dS)N)
rrZ	_protocolZconnection_lost�ZeroDivisionErrorr�assertRaisesrrr)r
rr r!r"rrr
�_basetest_open_connection_errords
z1StreamReaderTests._basetest_open_connection_errorcCsBtj��/}tj|jd|j�}|j|�WdQRXdS)Nr)rr%rr&r'rr7)r
r(r)rrr
�test_open_connection_errormsz,StreamReaderTests.test_open_connection_errorcCsBtj��/}tj|jd|j�}|j|�WdQRXdS)Nr)rr+rr,r'rr7)r
r(r)rrr
�test_open_unix_connection_errorssz1StreamReaderTests.test_open_unix_connection_errorcCs9tjd|j�}|jd�|jd|j�dS)Nr�)rrr�	feed_datar�_buffer)r
rrrr
�test_feed_empty_datazs
z&StreamReaderTests.test_feed_empty_datacCs?tjd|j�}|j|j�|j|j|j�dS)Nr)rrrr;�DATArr<)r
rrrr
�test_feed_nonempty_data�sz)StreamReaderTests.test_feed_nonempty_datacCsjtjd|j�}|j|j�|jj|jd��}|jd|�|j|j|j�dS)Nrrr:)	rrrr;r>rrrr<)r
rr#rrr
�test_read_zero�s
z StreamReaderTests.test_read_zerocs�tjd�j��tj�jd�d�j�}��fdd�}�jj|��jj|�}�j�j|��jd�j	�dS)Nr�cs�j�j�dS)N)r;r>r)r
rrr
�cb�sz'StreamReaderTests.test_read.<locals>.cbr:)
rrr�Taskr�	call_soonrrr>r<)r
�	read_taskrBr#r)r
rr
�	test_read�s!zStreamReaderTests.test_readcCsqtjd|j�}|jd�|jd�|jj|jd��}|jd|�|jd|j�dS)Nrsline1sline2�)rrrr;rrrr<)r
rr#rrr
�test_read_line_breaks�s

z'StreamReaderTests.test_read_line_breakscs�tjd|j��tj�jd�d|j�}�fdd�}|jj|�|jj|�}|jd|�|jd�j�dS)Nrics�j�dS)N)�feed_eofr)rrr
rB�sz+StreamReaderTests.test_read_eof.<locals>.cbr:)	rrrrCrrDrrr<)r
rErBr#r)rr
�
test_read_eof�s!zStreamReaderTests.test_read_eofcs�tjd|j��tj�jd�d|j�}�fdd�}|jj|�|jj|�}|jd|�|jd�j�dS)Nr�cs(�jd��jd��j�dS)Nschunk1
schunk2)r;rIr)rrr
rB�s

z1StreamReaderTests.test_read_until_eof.<locals>.cbs
chunk1
chunk2r:���)	rrrrCrrDrrr<)r
rErBr#r)rr
�test_read_until_eof�s!z%StreamReaderTests.test_read_until_eofcCs�tjd|j�}|jd�|jj|jd��}|jd|�|jt��|j	t|jj|jd��dS)Nrsline
�sli)
rrrr;rrr�
set_exception�
ValueErrorr6)r
rr#rrr
�test_read_exception�s
z%StreamReaderTests.test_read_exceptioncCsj|jtd��tjddd|j�WdQRX|jtd��tjddd|j�WdQRXdS)NZimit�limitrrrKrL)�assertRaisesRegexrPrrr)r
rrr
�test_invalid_limit�s z$StreamReaderTests.test_invalid_limitcCsjtjddd|j�}|jd�|jj|jd��}|jd|�|jd|j�dS)NrR�rschunkrGr:)rrrr;rrrr<)r
rr#rrr
�test_read_limit�s

z!StreamReaderTests.test_read_limitcs�tjd|j���jd�tj�j�d|j�}�fdd�}|jj|�|jj|�}|jd|�|jd�j	�dS)Nrschunk1 cs+�jd��jd��jd�dS)Nschunk2 schunk3 s
 chunk4)r;r)rrr
rB�s

z+StreamReaderTests.test_readline.<locals>.cbschunk1 chunk2 chunk3 
s chunk4)
rrrr;rCrrDrrr<)r
rErB�liner)rr
�
test_readline�s
zStreamReaderTests.test_readlinecCs�tjddd|j�}|jd�|jd�|jt|jj|j��|jd|j	�tjddd|j�}|jd�|jd�|jd�|jt|jj|j��|jd|j	�dS)	NrRrUrslis
ne1
line2
sline2
sne1r:)
rrrr;r6rPrrrr<)r
rrrr
�&test_readline_limit_with_existing_data�s




z8StreamReaderTests.test_readline_limit_with_existing_datacCs�tjd|j�}|j|j��|jd�|j|j��|jj|j��|j|j��|jd�|j�|jj|j��|j	|j��dS)Nrs
some data
)
rrrZassertFalseZat_eofr;rrrIr)r
rrrr
�test_at_eof	s


zStreamReaderTests.test_at_eofcs�tjddd|j���fdd�}|jj|�|jt|jj�j��|jd�j	�tjddd|j���fdd�}|jj|�|jt|jj�j��|jd�j	�tjddd|j���j
d	�|jj�j��}|jd	|�|jd�j	��j
d
�|jt��}|jj�j��WdQRX|jd�j	��j
d�|jt��}|jj�j��WdQRX|jd�j	�dS)NrR�rcs5�jd��jd��jd��j�dS)Nschunk1schunk2schunk3
)r;rIr)rrr
rBs


z1StreamReaderTests.test_readline_limit.<locals>.cbr:cs5�jd��jd��jd��j�dS)Nschunk1schunk2
schunk3
)r;rIr)rrr
rB+s


schunk3
s1234567
s	12345678
s12345678)rrrrDr6rPrrrr<r;)r
rBrW�cmr)rr
�test_readline_limits2


z%StreamReaderTests.test_readline_limitcCs�tjd|j�}|j|jdd��|j|jdd��|jj|j��}|jd|�|jd|j�dS)Nr�sline1
sline2
line3
)	rrrr;r>rrrr<)r
rrWrrr
�test_readline_nolimit_nowaitGsz.StreamReaderTests.test_readline_nolimit_nowaitcCsXtjd|j�}|jd�|j�|jj|j��}|jd|�dS)Nrs	some data)rrrr;rIrrr)r
rrWrrr
�test_readline_eofSs


z#StreamReaderTests.test_readline_eofcCsKtjd|j�}|j�|jj|j��}|jd|�dS)Nrr:)rrrrIrrr)r
rrWrrr
�test_readline_empty_eof[s
z)StreamReaderTests.test_readline_empty_eofcCs}tjd|j�}|j|j�|jj|j��|jj|jd��}|jd|�|jd|j	�dS)Nrr[sline2
lsine3
)
rrrr;r>rrrrr<)r
rr#rrr
�test_readline_read_byte_countbsz/StreamReaderTests.test_readline_read_byte_countcCs�tjd|j�}|jd�|jj|j��}|jd|�|jt��|j	t|jj|j��|jd|j
�dS)Nrsline
r:)rrrr;rrrrOrPr6r<)r
rr#rrr
�test_readline_exceptionms
z)StreamReaderTests.test_readline_exceptioncCsOtjd|j�}|jtd��!|jj|jdd��WdQRXdS)NrzSeparator should be�	separatorr:)rrrrSrPr�	readuntil)r
rrrr
�test_readuntil_separatorysz*StreamReaderTests.test_readuntil_separatorcCs�tjd|j�}|jd�|jj|jdd��}|jd|�|jd|j�|jd�|jj|jd��}|jd|�|jd|j�|jd�|jj|jd��}|jd|�|jd|j�dS)NrslineAAArdsAAAr:s
lineAAAxxxsxxx)rrrr;rrerr<)r
rr#rrr
�test_readuntil_multi_chunks~s


z-StreamReaderTests.test_readuntil_multi_chunkscCs�tjd|j�}|jd�|jd�|jd�|jj|jd��}|jd|�|jd|j�|jd�|jd�|jd	�|jj|jd��}|jd|�|jd|j�|jd�|jj|jd��}|jd|�|jd|j�|jd
�|jj|jd��}|jd
|�|jd|j�|jd�|jd�|jd�|jd�|jj|jd��}|jd|�|jd|j�dS)
NrsQWEaasXYaa�asaaas
QWEaaXYaaar:sXYasaasXaaasXXXsXXXaaa)rrrr;rrerr<)r
rr#rrr
�test_readuntil_multi_chunks_1�s8











z/StreamReaderTests.test_readuntil_multi_chunks_1c
Cs�tjd|j�}|jd�|j�|jtj�� }|jj|jd��WdQRX|j	|j
jd�|j|j
j
�|j	d|j�dS)Nrssome dataAAsAAAr:)rrrr;rIr6�IncompleteReadErrorrrer�	exception�partial�assertIsNone�expectedr<)r
rr\rrr
�test_readuntil_eof�s

 z$StreamReaderTests.test_readuntil_eofcCs�tjd|jdd�}|jd�|jtjd�� }|jj|jd��WdQRX|jd|j	�|jd�|jtjd�� }|jj|jd��WdQRX|jd	|j	�dS)
NrrRrUssome dataAAz	not foundsAAA�Azis foundssome dataAAA)
rrrr;rSZLimitOverrunErrorrrerr<)r
rr\rrr
�test_readuntil_limit_found_sep�s
 
 z0StreamReaderTests.test_readuntil_limit_found_sepc
Cs�tjd|j�}|j|j�|jj|jd��}|jd|�|j|j|j�|j	t
d��|jj|jd��WdQRX|j|j|j�dS)Nrrr:zless than zerorKrL)rrrr;r>r�readexactlyrr<rSrP)r
rr#rrr
�test_readexactly_zero_or_less�s z/StreamReaderTests.test_readexactly_zero_or_lesscs�tjd�j��dt�j�}tj�j|�d�j�}��fdd�}�jj|��jj|�}�j	�j�j|��j	�j�j
�dS)NrrNcs4�j�j��j�j��j�j�dS)N)r;r>r)r
rrr
rB�sz.StreamReaderTests.test_readexactly.<locals>.cb)rrr�lenr>rCrrrDrrr<)r
�nrErBr#r)r
rr
�test_readexactly�s!z"StreamReaderTests.test_readexactlycCsjtjddd|j�}|jd�|jj|jd��}|jd|�|jd|j�dS)NrRrUrschunkrGr:)rrrr;rrrrr<)r
rr#rrr
�test_readexactly_limit�s

z(StreamReaderTests.test_readexactly_limitc
s�tjd�j��dt�j�}tj�j|�d�j�}��fdd�}�jj|��jtj	��}�jj
|�WdQRX�j|jj
�j��j|jj|��jt|j�d��jd�j�dS)NrrNcs�j�j��j�dS)N)r;r>rIr)r
rrr
rB�sz2StreamReaderTests.test_readexactly_eof.<locals>.cbz-18 bytes read on a total of 36 expected bytesr:)rrrrtr>rCrrrDr6rjrrrkrlrn�strr<)r
rurErBr\r)r
rr
�test_readexactly_eof�s!z&StreamReaderTests.test_readexactly_eofcCs�tjd|j�}|jd�|jj|jd��}|jd|�|jt��|j	t|jj|jd��dS)Nrsline
rNsli)
rrrr;rrrrrOrPr6)r
rr#rrr
�test_readexactly_exceptions
z,StreamReaderTests.test_readexactly_exceptioncCsXtjd|j�}|j|j��t�}|j|�|j|j�|�dS)Nr)rrrrmrkrPrOr)r
r�excrrr
�test_exceptions
	
z StreamReaderTests.test_exceptioncs�tjd|j��tj�fdd��}tj�j�d|j�}tj|�d|j�}|jjtj||gd|j��|jt	|j
�dS)Nrcs�jt��dS)N)rOrPr)rrr
�set_errsz8StreamReaderTests.test_exception_waiter.<locals>.set_err)rrr�	coroutinerCrr�waitr6rP�result)r
r}Zt1Zt2r)rr
�test_exception_waiters(z'StreamReaderTests.test_exception_waitercCs�tjd|j�}tj|j�d|j�}tj|j�|j�tj|j�|jt	d��tj|j�|j
|jd�dS)Nr�message)rrrrCrrrZcancelrO�RuntimeErrorr�_waiter)r
r�trrr
�test_exception_cancel(s
z'StreamReaderTests.test_exception_cancelcs�Gdd�d�}tj�fdd��}|�j�}|j�}�jjtj||�d�j��}|j��j|d�|�j�}|j�}�jjtj||�d�j��}|j��j|d�dS)Nc@saeZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
d
S)z5StreamReaderTests.test_start_server.<locals>.MyServercSsd|_||_dS)N)�serverr)r
rrrr
�__init__8s	z>StreamReaderTests.test_start_server.<locals>.MyServer.__init__css;|j�EdH}|j|�|j�EdH|j�dS)N)rr�drainr)r
�
client_reader�
client_writerr#rrr
�
handle_client<s
zCStreamReaderTests.test_start_server.<locals>.MyServer.handle_clientcSsStj�}|jd�|jjtj|jd|d|j��|_|j�S)N�	127.0.0.1r�sockr)r�r)	�socket�bindrrr�start_serverr�r��getsockname)r
r�rrr
�startCs
	z;StreamReaderTests.test_start_server.<locals>.MyServer.startcSs |jj|j||��dS)N)r�create_taskr�)r
r�r�rrr
�handle_client_callbackLszLStreamReaderTests.test_start_server.<locals>.MyServer.handle_client_callbackc	Ssqtj�}|jd�|j�}|j�|jjtj|jd|dd|dd|j��|_	|S)N�	127.0.0.1r�host�portrKr)r�r)
r�r�r�rrrrr�r�r�)r
r��addrrrr
�start_callbackPs

	zDStreamReaderTests.test_start_server.<locals>.MyServer.start_callbackcSsB|jdk	r>|jj�|jj|jj��d|_dS)N)r�rrr�wait_closed)r
rrr
�stop[s
z:StreamReaderTests.test_start_server.<locals>.MyServer.stopN)�__name__�
__module__�__qualname__r�rr~r�r�r�r�r�rrrr
�MyServer6s	r�c3sOtj|d�j�EdH\}}|jd�|j�EdH}|j�|S)Nrs
hello world!
)rr&rrrr)r�r r!�msgback)r
rr
�clientas

z3StreamReaderTests.test_start_server.<locals>.clientrs
hello world!
)	rr~rr�rrCr�rr�)r
r�r�r�r��msgr)r
r
�test_start_server4s+

z#StreamReaderTests.test_start_servercsGdd�d�}tj�fdd��}tj��g}|�j|�}|j��jjtj||�d�j��}|j��j	|d�WdQRXtj��g}|�j|�}|j
��jjtj||�d�j��}|j��j	|d�WdQRXdS)Nc@saeZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
d
S)z:StreamReaderTests.test_start_unix_server.<locals>.MyServercSsd|_||_||_dS)N)r�r�path)r
rr�rrr
r��s		zCStreamReaderTests.test_start_unix_server.<locals>.MyServer.__init__css;|j�EdH}|j|�|j�EdH|j�dS)N)rrr�r)r
r�r�r#rrr
r��s
zHStreamReaderTests.test_start_unix_server.<locals>.MyServer.handle_clientcSs7|jjtj|jd|jd|j��|_dS)Nr�r)rrr�start_unix_serverr�r�r�)r
rrr
r��s		z@StreamReaderTests.test_start_unix_server.<locals>.MyServer.startcSs |jj|j||��dS)N)rr�r�)r
r�r�rrr
r��szQStreamReaderTests.test_start_unix_server.<locals>.MyServer.handle_client_callbackcSs=tj|jd|jd|j�}|jj|�|_dS)Nr�r)rr�r�r�rrr�)r
r�rrr
r��s	zIStreamReaderTests.test_start_unix_server.<locals>.MyServer.start_callbackcSsB|jdk	r>|jj�|jj|jj��d|_dS)N)r�rrrr�)r
rrr
r��s
z?StreamReaderTests.test_start_unix_server.<locals>.MyServer.stopN)r�r�r�r�rr~r�r�r�r�r�rrrr
r�sr�c3sOtj|d�j�EdH\}}|jd�|j�EdH}|j�|S)Nrs
hello world!
)rr,rrrr)r�r r!r�)r
rr
r��s

z8StreamReaderTests.test_start_unix_server.<locals>.clientrs
hello world!
)rr~rZunix_socket_pathrr�rrCr�rr�)r
r�r�r�r�r�r)r
r
�test_start_unix_server|s $



z(StreamReaderTests.test_start_unix_server�win32zDon't have pipesc
snd}tj�\}}tjd|t|�g}t|dd�}tjd|jdd�}tj	|d|j��|jj
|jj�fdd	�|��\}}tj�}	|	j
|j�zZtj|	�tj|d
|hd|j�}
|jj
|
�}|jj
|j��Wdtjd�Xtj|�|jj
|jd��}|j|d�dS)
NzHimport os, sys
fd = int(sys.argv[1])
os.write(fd, b'data')
os.close(fd)
z-c�rbrrrRrKcs�S)Nrr)�protocolrr
�<lambda>�szBStreamReaderTests.test_read_all_from_pipe_reader.<locals>.<lambda>Zpass_fdssdatarL)�os�pipe�sys�
executablerx�openrrr�StreamReaderProtocolrZconnect_read_pipeZSafeChildWatcherZattach_loopZset_child_watcherZcreate_subprocess_execrrrr)
r
�codeZrfdZwfd�argsr�r Z	transport�_ZwatcherZcreate�procr#r)r�r
�test_read_all_from_pipe_reader�s*
	*
	
z0StreamReaderTests.test_read_all_from_pipe_readercCsI|jtjd�tj|j�tj�}|j|j|j�dS)N)�
addCleanuprr	rrrr)r
r rrr
�test_streamreader_constructor�sz/StreamReaderTests.test_streamreader_constructorcCsX|jtjd�tj|j�tj�}tj|�}|j|j|j�dS)N)	r�rr	rr�Mockr�rr)r
r r�rrr
�%test_streamreaderprotocol_constructor�s
z7StreamReaderTests.test_streamreaderprotocol_constructorc
s�tj���fdd�}tj�fdd��}tjd|�}|jd�|j��j�}�j	t
tf���jj
||��WdQRX|j�dS)Nc
smtj�}|�T|jd�|jd�|j�}�j|�|j�\}}|j�WdQRXdS)N�	localhostrrK)r�r)r�r�Zlistenr�ZputZacceptr)r�r�Zcltr�)�qrr
r�s


z3StreamReaderTests.test_drain_raises.<locals>.serverc3sMtj||d�j�EdH\}}x |jd�|j�EdHq)WdS)Nrsfoo
)rr&rrr�)r�r�r r!)r
rr
r�s
 
z3StreamReaderTests.test_drain_raises.<locals>.client�targetT)�queueZQueuerr~�	threadingZThreadZ	setDaemonr��getr6�ConnectionResetError�BrokenPipeErrorrr�join)r
r�r�Zthreadr�r)r�r
r
�test_drain_raises�s


z#StreamReaderTests.test_drain_raisescCs/tjd|j�}|jdt|��dS)Nrz<StreamReader>)rrrr�repr)r
rrrr
�
test___repr__&szStreamReaderTests.test___repr__cCs5tjd|jdd�}|jdt|��dS)NrrR�{z<StreamReader l=123>)rrrrr�)r
rrrr
�test___repr__nondefault_limit*sz/StreamReaderTests.test___repr__nondefault_limitcCs9tjd|j�}|j�|jdt|��dS)Nrz<StreamReader eof>)rrrrIrr�)r
rrrr
�test___repr__eof.s
z"StreamReaderTests.test___repr__eofcCs<tjd|j�}|jd�|jdt|��dS)Nrsdataz<StreamReader 4 bytes>)rrrr;rr�)r
rrrr
�test___repr__data3s
z#StreamReaderTests.test___repr__datacCsEtjd|j�}t�}|j|�|jdt|��dS)Nrz<StreamReader e=RuntimeError()>)rrrr�rOrr�)r
rr{rrr
�test___repr__exception8s	
z(StreamReaderTests.test___repr__exceptioncCs�tjd|j�}tjd|j�|_|jt|�d�|jjd�|jj|j�d|_|j	dt|��dS)Nrz'<StreamReader w=<Future pending[\S ]*>>z<StreamReader>)
rrrZFuturer�ZassertRegexr�Z
set_resultrr)r
rrrr
�test___repr__waiter>s		z%StreamReaderTests.test___repr__waitercCs_tjd|j�}tj�|_tj�|j_d|jj_|jdt	|��dS)Nrz<Transport>z<StreamReader t=<Transport>>)
rrrrr�Z
_transport�__repr__rrr�)r
rrrr
�test___repr__transportIs
z(StreamReaderTests.test___repr__transport)Gr�r�r�r>rrrZpatchrr$r*�unittestZ
skipUnless�hasattrr�r-r.ZskipIfr0r2r4r7r8r9r=r?r@rFrHrJrMrQrTrVrXrYrZr]r_r`rarbrcrfrgrirorqrsrvrwryrzr|r�r�r�r�r��platformr�r�r�r�r�r�r�r�r�r�r�rr)rr
rsv'$
*	'	

/#
H'D''	
,r�__main__)�__doc__rr�r�r�r�r�r�rr0�ImportErrorrrZTestCaserr��mainrrrr
�<module>s(
���@