403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.40
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/test_asyncio/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/test_asyncio/__pycache__/test_streams.cpython-36.pyc
3

�w2_^~�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	yddl
Z
Wnek
rtdZ
YnXddlZddlm
Z
Gdd�de
j�Zedkr�ej�dS)zTests for streams.py.�N)�mock)�
test_utilscsxeZdZdZ�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�ZFd{d|�ZGd}d~�ZH�ZIS)�StreamReaderTestssline1
line2
line3
cs$t�j�tj�|_|j|j�dS)N)�super�setUp�asyncioZnew_event_loop�loop�set_event_loop)�self)�	__class__��C/opt/alt/python36/lib64/python3.6/test/test_asyncio/test_streams.pyrs

zStreamReaderTests.setUpcs,tj|j�|jj�tj�t�j�dS)N)r�run_brieflyr�close�gcZcollectr�tearDown)r
)rrr
rs
zStreamReaderTests.tearDownzasyncio.streams.eventscCstj�}|j|j|jj�dS)N)r�StreamReader�assertIs�_loopZget_event_loop�return_value)r
Zm_events�streamrrr
�test_ctor_global_loop&sz'StreamReaderTests.test_ctor_global_loopcCsj|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_connectioncCs6tj��$}tj|jd|ji�}|j|�WdQRXdS)Nr)r�run_test_serverr�open_connection�addressrr$)r
�httpd�conn_futrrr
�test_open_connection6s


z&StreamReaderTests.test_open_connectionZAF_UNIXzNo UNIX SocketscCs4tj��"}tj|j|jd�}|j|�WdQRXdS)N)r)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_sslCs
z7StreamReaderTests._basetest_open_connection_no_loop_sslNz
No ssl modulecCs@tjdd��*}tj|jtj�|jd��}|j|�WdQRXdS)NT)�use_ssl)�sslr)rr%rr&r'�dummy_ssl_contextrr.)r
r(r)rrr
� test_open_connection_no_loop_sslOsz2StreamReaderTests.test_open_connection_no_loop_sslc
Cs@tjdd��*}tj|jtj�d|jd�}|j|�WdQRXdS)NT)r/�)r0Zserver_hostnamer)rr+rr,r'r1rr.)r
r(r)rrr
�%test_open_unix_connection_no_loop_sslYs
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_erroresz1StreamReaderTests._basetest_open_connection_errorcCs6tj��$}tj|jd|ji�}|j|�WdQRXdS)Nr)rr%rr&r'rr7)r
r(r)rrr
�test_open_connection_errorns


z,StreamReaderTests.test_open_connection_errorcCs4tj��"}tj|j|jd�}|j|�WdQRXdS)N)r)rr+rr,r'rr7)r
r(r)rrr
�test_open_unix_connection_errorts

z1StreamReaderTests.test_open_unix_connection_errorcCs*tj|jd�}|jd�|jd|j�dS)N)r�)rrr�	feed_datar�_buffer)r
rrrr
�test_feed_empty_data{s
z&StreamReaderTests.test_feed_empty_datacCs.tj|jd�}|j|j�|j|j|j�dS)N)r)rrrr;�DATArr<)r
rrrr
�test_feed_nonempty_data�sz)StreamReaderTests.test_feed_nonempty_datacCsLtj|jd�}|j|j�|jj|jd��}|jd|�|j|j|j�dS)N)rrr:)	rrrr;r>rrrr<)r
rr#rrr
�test_read_zero�s
z StreamReaderTests.test_read_zerocsjtj�jd��tj�jd��jd�}��fdd�}�jj|��jj|�}�j�j|��jd�j	�dS)N)r�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_readcCsRtj|jd�}|jd�|jd�|jj|jd��}|jd|�|jd|j�dS)N)rsline1sline2�)rrrr;rrrr<)r
rr#rrr
�test_read_line_breaks�s

z'StreamReaderTests.test_read_line_breakscsftj|jd��tj�jd�|jd�}�fdd�}|jj|�|jj|�}|jd|�|jd�j�dS)N)rics�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_eofcsftj|jd��tj�jd�|jd�}�fdd�}|jj|�|jj|�}|jd|�|jd�j�dS)N)r�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^tj|jd�}|jd�|jj|jd��}|jd|�|jt��|j	t|jj|jd��dS)N)rsline
�sli)
rrrr;rrr�
set_exception�
ValueErrorr6)r
rr#rrr
�test_read_exception�s
z%StreamReaderTests.test_read_exceptioncCsT|jtd��tjd|jd�WdQRX|jtd��tjd|jd�WdQRXdS)NZimitr)�limitrrKrL)�assertRaisesRegexrPrrr)r
rrr
�test_invalid_limit�sz$StreamReaderTests.test_invalid_limitcCsJtjd|jd�}|jd�|jj|jd��}|jd|�|jd|j�dS)N�)rRrschunkrGr:)rrrr;rrrr<)r
rr#rrr
�test_read_limit�s

z!StreamReaderTests.test_read_limitcsntj|jd���jd�tj�j�|jd�}�fdd�}|jj|�|jj|�}|jd|�|jd�j	�dS)N)rschunk1 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�tjd|jd�}|jd�|jd�|jt|jj|j��|jd|j	�tjd|jd�}|jd�|jd�|jd�|jt|jj|j��|jd|j	�dS)NrU)rRrslis
ne1
line2
sline2
sne1r:)
rrrr;r6rPrrrr<)r
rrrr
�&test_readline_limit_with_existing_data�s




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

zStreamReaderTests.test_at_eofcs\tjd|jd���fdd�}|jj|�|jt|jj�j��|jd�j	�tjd|jd���fdd�}|jj|�|jt|jj�j��|jd�j	�tjd|jd���j
d�|jj�j��}|jd|�|jd�j	��j
d	�|jt��}|jj�j��WdQRX|jd�j	��j
d
�|jt��}|jj�j��WdQRX|jd�j	�dS)N�)rRrcs*�jd��jd��jd��j�dS)Nschunk1schunk2schunk3
)r;rIr)rrr
rBs


z1StreamReaderTests.test_readline_limit.<locals>.cbr:cs*�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_limitcCsdtj|jd�}|j|jdd��|j|jdd��|jj|j��}|jd|�|jd|j�dS)N)r�sline1
sline2
line3
)	rrrr;r>rrrr<)r
rrWrrr
�test_readline_nolimit_nowaitHsz.StreamReaderTests.test_readline_nolimit_nowaitcCs@tj|jd�}|jd�|j�|jj|j��}|jd|�dS)N)rs	some data)rrrr;rIrrr)r
rrWrrr
�test_readline_eofTs

z#StreamReaderTests.test_readline_eofcCs6tj|jd�}|j�|jj|j��}|jd|�dS)N)rr:)rrrrIrrr)r
rrWrrr
�test_readline_empty_eof\sz)StreamReaderTests.test_readline_empty_eofcCsZtj|jd�}|j|j�|jj|j��|jj|jd��}|jd|�|jd|j	�dS)N)rr[sline2
lsine3
)
rrrr;r>rrrrr<)r
rr#rrr
�test_readline_read_byte_countcsz/StreamReaderTests.test_readline_read_byte_countcCshtj|jd�}|jd�|jj|j��}|jd|�|jt��|j	t|jj|j��|jd|j
�dS)N)rsline
r:)rrrr;rrrrOrPr6r<)r
rr#rrr
�test_readline_exceptionns
z)StreamReaderTests.test_readline_exceptioncCs>tj|jd�}|jtd��|jj|jdd��WdQRXdS)N)rzSeparator should ber:)�	separator)rrrrSrPr�	readuntil)r
rrrr
�test_readuntil_separatorzsz*StreamReaderTests.test_readuntil_separatorcCs�tj|jd�}|jd�|jj|jdd��}|jd|�|jd|j�|jd�|jj|jd��}|jd|�|jd|j�|jd�|jj|jd��}|jd|�|jd|j�dS)N)rslineAAAsAAA)rdr:s
lineAAAxxxsxxx)rrrr;rrerr<)r
rr#rrr
�test_readuntil_multi_chunkss


z-StreamReaderTests.test_readuntil_multi_chunkscCsftj|jd�}|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)
N)rsQWEaasXYaa�asaaas
QWEaaXYaaar:sXYasaasXaaasXXXsXXXaaa)rrrr;rrerr<)r
rr#rrr
�test_readuntil_multi_chunks_1�s8











z/StreamReaderTests.test_readuntil_multi_chunks_1c
Csztj|jd�}|jd�|j�|jtj��}|jj|jd��WdQRX|j	|j
jd�|j|j
j
�|j	d|j�dS)N)rssome dataAAsAAAr:)rrrr;rIr6�IncompleteReadErrorrrer�	exception�partial�assertIsNone�expectedr<)r
rr\rrr
�test_readuntil_eof�s
z$StreamReaderTests.test_readuntil_eofcCs�tj|jdd�}|jd�|jtjd��}|jj|jd��WdQRX|jd|j	�|jd�|jtjd��}|jj|jd��WdQRX|jd|j	�dS)	NrU)rrRssome dataAAz	not foundsAAA�Azis foundssome dataAAA)
rrrr;rS�LimitOverrunErrorrrerr<)r
rr\rrr
�test_readuntil_limit_found_sep�s

z0StreamReaderTests.test_readuntil_limit_found_sepc
Cs�tj|jd�}|j|j�|jj|jd��}|jd|�|j|j|j�|j	t
d��|jj|jd��WdQRX|j|j|j�dS)N)rrr: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�tj�jd��dt�j�}tj�j|��jd�}��fdd�}�jj|��jj|�}�j	�j�j|��j	�j�j
�dS)N)rrNcs(�j�j��j�j��j�j�dS)N)r;r>r)r
rrr
rB�sz.StreamReaderTests.test_readexactly.<locals>.cb)rrr�lenr>rCrsrDrrr<)r
�nrErBr#r)r
rr
�test_readexactly�sz"StreamReaderTests.test_readexactlycCsJtjd|jd�}|jd�|jj|jd��}|jd|�|jd|j�dS)NrU)rRrschunkrGr:)rrrr;rrsrr<)r
rr#rrr
�test_readexactly_limit�s

z(StreamReaderTests.test_readexactly_limitc
s�tj�jd��dt�j�}tj�j|��jd�}��fdd�}�jj|��jtj	��}�jj
|�WdQRX�j|jj
�j��j|jj|��jt|j�d��jd�j�dS)N)rrNcs�j�j��j�dS)N)r;r>rIr)r
rrr
rB�sz2StreamReaderTests.test_readexactly_eof.<locals>.cbz-18 bytes read on a total of 36 expected bytesr:)rrrrur>rCrsrDr6rjrrrkrlrn�strr<)r
rvrErBr\r)r
rr
�test_readexactly_eof�sz&StreamReaderTests.test_readexactly_eofcCs^tj|jd�}|jd�|jj|jd��}|jd|�|jt��|j	t|jj|jd��dS)N)rsline
rNsli)
rrrr;rrsrrOrPr6)r
rr#rrr
�test_readexactly_exceptions
z,StreamReaderTests.test_readexactly_exceptioncCs@tj|jd�}|j|j��t�}|j|�|j|j�|�dS)N)r)rrrrmrkrPrOr)r
r�excrrr
�test_exceptions

z StreamReaderTests.test_exceptioncsttj|jd��tj�fdd��}tj�j�|jd�}tj|�|jd�}|jjtj||g|jd��|jt	|j
�dS)N)rcs�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_waitercCsntj|jd�}tj|j�|jd�}tj|j�|j�tj|j�|jt	d��tj|j�|j
|jd�dS)N)r�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||��jd��}|j��j|d�|�j�}|j�}�jjtj||��jd��}|j��j|d�dS)Nc@sBeZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
d
S)z5StreamReaderTests.test_start_server.<locals>.MyServercSsd|_||_dS)N)�serverr)r
rrrr
�__init__9sz>StreamReaderTests.test_start_server.<locals>.MyServer.__init__css2|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_clientcSs8tj�}|jd�|jjtj|j||jd��|_|j�S)N�	127.0.0.1r)�sockr)r�r)	�socket�bindrrr�start_serverr�r��getsockname)r
r�rrr
�startDs
z;StreamReaderTests.test_start_server.<locals>.MyServer.startcSs|jj|j||��dS)N)r�create_taskr�)r
r�r�rrr
�handle_client_callbackMszLStreamReaderTests.test_start_server.<locals>.MyServer.handle_client_callbackcSsNtj�}|jd�|j�}|j�|jjtj|j|d|d|jd��|_	|S)N�	127.0.0.1rrK)�host�portr)r�r)
r�r�r�rrrrr�r�r�)r
r��addrrrr
�start_callbackQs
zDStreamReaderTests.test_start_server.<locals>.MyServer.start_callbackcSs0|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�rrr�r�r�r�r�rrrr
�MyServer7s	r�c3s@tj|d�ji�EdH\}}|jd�|j�EdH}|j�|S)Nrs
hello world!
)rr&rrrr)r�r r!�msgback)r
rr
�clientbs
z3StreamReaderTests.test_start_server.<locals>.client)rs
hello world!
)	rrrr�rrCr�rr�)r
r�r�r�r��msgr)r
r
�test_start_server5s+

z#StreamReaderTests.test_start_servercs�Gdd�d�}tj�fdd��}tj��J}|�j|�}|j��jjtj||��jd��}|j��j	|d�WdQRXtj��J}|�j|�}|j
��jjtj||��jd��}|j��j	|d�WdQRXdS)Nc@sBeZdZdd�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��szCStreamReaderTests.test_start_unix_server.<locals>.MyServer.__init__css2|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_clientcSs$|jjtj|j|j|jd��|_dS)N)r�r)rrr�start_unix_serverr�r�r�)r
rrr
r��sz@StreamReaderTests.test_start_unix_server.<locals>.MyServer.startcSs|jj|j||��dS)N)rr�r�)r
r�r�rrr
r��szQStreamReaderTests.test_start_unix_server.<locals>.MyServer.handle_client_callbackcSs(tj|j|j|jd�}|jj|�|_dS)N)r�r)rr�r�r�rrr�)r
r�rrr
r��s
zIStreamReaderTests.test_start_unix_server.<locals>.MyServer.start_callbackcSs0|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�rrr�r�r�r�r�rrrr
r��sr�c3s>tj|�jd�EdH\}}|jd�|j�EdH}|j�|S)N)rs
hello world!
)rr,rrrr)r�r r!r�)r
rr
r��s
z8StreamReaderTests.test_start_unix_server.<locals>.client)rs
hello world!
)rrrZunix_socket_pathrr�rrCr�rr�)r
r�r�r�r�r�r)r
r
�test_start_unix_server}s $

z(StreamReaderTests.test_start_unix_serverZwin32zDon't have pipesc
s�d}tj�\}}tjd|t|�g}t|dd�}tj|jdd�}tj	||jd��|jj
|jj�fdd	�|��\}}tj�}	|	j
|j�z@tj|	�tj||h|jd
��}
|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�rbrrK)rrR)rcs�S)Nrr)�protocolrr
�<lambda>�szBStreamReaderTests.test_read_all_from_pipe_reader.<locals>.<lambda>)Zpass_fdsrsdatarL)�os�pipe�sys�
executablery�openrrr�StreamReaderProtocolrZconnect_read_pipeZSafeChildWatcherZattach_loopZset_child_watcherZcreate_subprocess_execr�rrr)
r
�codeZrfdZwfd�argsr�r Z	transport�_ZwatcherZcreate�procr#r)r�r
�test_read_all_from_pipe_reader�s*


z0StreamReaderTests.test_read_all_from_pipe_readercCs6|jtjd�tj|j�tj�}|j|j|j�dS)N)�
addCleanuprr	rrrr)r
r rrr
�test_streamreader_constructor�sz/StreamReaderTests.test_streamreader_constructorcCs@|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��}tj|d�}|jd�|j��j�}�j	t
tf���jj
||��WdQRX|j�dS)Nc
sVtj�}|�@|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>.serverc3s>tj||�jd�EdH\}}x|jd�|j�EdHqWdS)N)rsfoo
)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"tj|jd�}|jdt|��dS)N)rz<StreamReader>)rrrr�repr)r
rrrr
�
test___repr__'szStreamReaderTests.test___repr__cCs$tj|jdd�}|jdt|��dS)N�{)rrRz<StreamReader l=123>)rrrrr�)r
rrrr
�test___repr__nondefault_limit+sz/StreamReaderTests.test___repr__nondefault_limitcCs*tj|jd�}|j�|jdt|��dS)N)rz<StreamReader eof>)rrrrIrr�)r
rrrr
�test___repr__eof/sz"StreamReaderTests.test___repr__eofcCs,tj|jd�}|jd�|jdt|��dS)N)rsdataz<StreamReader 4 bytes>)rrrr;rr�)r
rrrr
�test___repr__data4s
z#StreamReaderTests.test___repr__datacCs2tj|jd�}t�}|j|�|jdt|��dS)N)rz<StreamReader e=RuntimeError()>)rrrr�rOrr�)r
rr|rrr
�test___repr__exception9s
z(StreamReaderTests.test___repr__exceptioncCsbtj|jd�}tj|jd�|_|jt|�d�|jjd�|jj|j�d|_|j	dt|��dS)N)rz'<StreamReader w=<Future pending[\S ]*>>z<StreamReader>)
rrrZFuturer�ZassertRegexr�Z
set_resultrr)r
rrrr
�test___repr__waiter?sz%StreamReaderTests.test___repr__waitercCsBtj|jd�}tj�|_tj�|j_d|jj_|jdt	|��dS)N)rz<Transport>z<StreamReader t=<Transport>>)
rrrrr�Z
_transport�__repr__rrr�)r
rrrr
�test___repr__transportJs


z(StreamReaderTests.test___repr__transportc
Cs�tjdd�}xvttjd�D]d}|j|d��Ntjtj||d��}|jt	|�t	|��|j|j
|j
�|j|j|j�WdQRXqWdS)Nsabc�
rK)�pickle_protocol)r�)rrj�range�pickle�HIGHEST_PROTOCOL�subTest�loads�dumpsrryrlrn)r
�e�proto�e2rrr
�#test_IncompleteReadError_pickleableQsz5StreamReaderTests.test_IncompleteReadError_pickleablec
Csxtjdd�}xfttjd�D]T}|j|d��>tjtj||d��}|jt	|�t	|��|j|j
|j
�WdQRXqWdS)Nr�r�rK)r�)r�)rrqr�r�r�r�r�r�rry�consumed)r
r�r�r�rrr
�!test_LimitOverrunError_pickleableZsz3StreamReaderTests.test_LimitOverrunError_pickleable)Jr�r�r�r>rrrZpatchrr$r*�unittestZ
skipUnless�hasattrr�r-r.ZskipIfr0r2r4r7r8r9r=r?r@rFrHrJrMrQrTrVrXrYrZr]r_r`rarbrcrfrgrirorrrtrwrxrzr{r}r�r�r�r�r��platformr�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__rr)rr
rsz
		

/#
HD'	
,	r�__main__)�__doc__rr�r�r�r�r�r�r�rr0�ImportErrorrrZTestCaserr��mainrrrr
�<module>s0
T

Youez - 2016 - github.com/yon3zu
LinuXploit