HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/test/test_asyncio/__pycache__/test_proactor_events.cpython-311.pyc
�

��VcT����dZddlZddlZddlZddlZddlmZddlZddlmZddlm	Z	ddlm
Z
ddlmZddlmZdd	l
mZdd
l
mZddlmZd�Zd
�ZGd�dej��ZGd�dej��ZGd�dej��Zejejdkd��Gd�dej����Zedkrej��dSdS)zTests for proactor_events.py�N)�mock)�BaseProactorEventLoop)�_ProactorSocketTransport)�_ProactorWritePipeTransport)�_ProactorDuplexPipeTransport)�_ProactorDatagramTransport)�	os_helper)�
socket_helper)�utilsc�.�tjd��dS�N)�asyncio�set_event_loop_policy���:D:\Python311\Lib\test\test_asyncio\test_proactor_events.py�tearDownModulers���!�$�'�'�'�'�'rc�X�|j�dS|j���d|_dSr
)�_sock�close)�	transports r�close_transportrs2�������
�O�������I�O�O�Orc���eZdZ�fd�Zd-d�Zd�Zd�Zd�Zej	e
jjd��d���Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zejd��d���Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z ejd��d���Z!d�Z"d�Z#d�Z$d �Z%d!�Z&d"�Z'd#�Z(d$�Z)d%�Z*d&�Z+d'�Z,d(�Z-d)�Z.d*�Z/d+�Z0d,�Z1�xZ2S).�ProactorSocketTransportTestsc���t�����|���|_|�|jj��t
j��|_|j|j_	tjtj
��|_t
jtj��|_d|_dS)Ni)�super�setUp�
new_test_loop�loop�
addCleanuprr�Mock�proactor�	_proactor�
test_utils�make_test_protocolr�Protocol�protocol�socket�sock�buffer_size��self�	__class__s �rrz"ProactorSocketTransportTests.setUp#s����
���
�
�����&�&�(�(��	�����	��(�(�(��	����
�"�m��	��"�5�g�6F�G�G��
��I�f�m�,�,��	� ����rNc��t|j|j|j|���}|�t
|��|S�N)�waiter)rrr)r'r r)r,r0rs   r�socket_transportz-ProactorSocketTransportTests.socket_transport-sB��,�T�Y��	�-1�]�6�K�K�K�	������3�3�3��rc��|j���}|�|���}tj|j��|�|�����|j�|��|j	j
�|jt|j����dSr/)r�
create_futurer1r$�run_briefly�assertIsNone�resultr'�connection_mader"�	recv_into�assert_called_withr)�	bytearrayr*�r,�fut�trs   r�	test_ctorz&ProactorSocketTransportTests.test_ctor3s����i�%�%�'�'��
�
"�
"�#�
"�
.�
.����t�y�)�)�)����#�*�*�,�,�'�'�'��
�%�%�b�)�)�)��
��2�2�4�9�i��HX�>Y�>Y�Z�Z�Z�Z�Zrc�^�|���}|���|jjj�|jt|j����|�	|j
jj��|�	|j
j
j��dSr
)r1�
_loop_readingrr#r8r9r)r:r*�assertFalser'�
data_received�called�eof_received�r,r=s  r�test_loop_readingz.ProactorSocketTransportTests.test_loop_reading;s���
�
"�
"�
$�
$��
�������	��%�8�8���I�d�N^�D_�D_�`�`�`������4�;�<�<�<������3�:�;�;�;�;�;rc��d}|j���}|�t|����|���}||_||jdt|���<|�|��t|j	��}||dt|���<|jj
j�|j
|��|jj�t|����dS�N�data)rr3�
set_result�lenr1�	_read_fut�_datar@r:r*r#r8r9r)r'rB)r,�buf�resr=�
called_bufs     r�test_loop_reading_dataz3ProactorSocketTransportTests.test_loop_reading_dataBs������i�%�%�'�'�����s�3�x�x� � � �
�
"�
"�
$�
$�����!����#�c�(�(���
��������t�/�0�0�
� #�
�9�C��H�H�9���	��%�8�8���J�O�O�O��
�#�6�6�y��~�~�F�F�F�F�Fr�)Assertions are disabled in optimized modec��|j���}|�d��|���}|�t
|j|��tj��|_	||_
|�|��|�|jjj
j��|�|jjj��|�|j	j��dS�Nr)rr3rJr1�assertRaises�AssertionErrorr@rr!rrLrAr#r8rC�
assertTruer'rD�r,rOr=s   r�test_loop_reading_no_dataz6ProactorSocketTransportTests.test_loop_reading_no_dataPs����i�%�%�'�'�����q����
�
"�
"�
$�
$�����.�"�*:�C�@�@�@��9�;�;������
������������,�6�=�>�>�>�����
�2�9�:�:�:�������(�(�(�(�(rc��t��x}|jjj_|���}t
j��|_|�	��|j�
|d��dS�Nz"Fatal read error on pipe transport)�ConnectionAbortedErrorrr#r8�side_effectr1rr!�_fatal_errorr@r9�r,�errr=s   r�test_loop_reading_abortedz6ProactorSocketTransportTests.test_loop_reading_aborted_s|��:P�:R�:R�R��d�i�!�+�7�
�
"�
"�
$�
$���)�+�+���
������
��*�*��@�	B�	B�	B�	B�	Brc��t��|jjj_|���}d|_tj��|_	|�
��|�|j	j��dS�NT)
r\rr#r8r]r1�_closingrr!r^r@rArCrEs  r�!test_loop_reading_aborted_closingz>ProactorSocketTransportTests.test_loop_reading_aborted_closingisn��4J�4L�4L��	��%�1�
�
"�
"�
$�
$������)�+�+���
�����������/�0�0�0�0�0rc��t��|jjj_|���}d|_tj��|_	|�
��|�|j	j��dS�NF)
r\rr#r8r]r1rdrr!r^r@rWrCrEs  r�"test_loop_reading_aborted_is_fatalz?ProactorSocketTransportTests.test_loop_reading_aborted_is_fatalrsl��4J�4L�4L��	��%�1�
�
"�
"�
$�
$������)�+�+���
�����������.�/�/�/�/�/rc�~�t��x}|jjj_|���}d|_tj��|_	tj��|_
|���|�|j	j
��|j
�|��dSrg)�ConnectionResetErrorrr#r8r]r1rdrr!r^�_force_closer@rArCr9r_s   r�!test_loop_reading_conn_reset_lostz>ProactorSocketTransportTests.test_loop_reading_conn_reset_lostzs���:N�:P�:P�P��d�i�!�+�7�
�
"�
"�
$�
$������)�+�+����)�+�+���
�����������/�0�0�0�
��*�*�3�/�/�/�/�/rc��t��x}|jjj_|���}t
j��|_|�	��|j�
|d��dSr[)�OSErrorrr#r8r]r1rr!r^r@r9r_s   r�test_loop_reading_exceptionz8ProactorSocketTransportTests.test_loop_reading_exception�sz��;B�9�9�E��d�i�!�+�7�
�
"�
"�
$�
$���)�+�+���
������
��*�*��@�	B�	B�	B�	B�	Brc���|���}tj��|_|�d��|�|jd��|j�d���dS)NrI)�data)r1rr!�
_loop_writing�write�assertEqual�_bufferr9rEs  r�
test_writez'ProactorSocketTransportTests.test_write�sk��
�
"�
"�
$�
$���9�;�;���
������������T�*�*�*�
��+�+��+�9�9�9�9�9rc��|���}|�d��|�|j��dS)Nr)r1rsrArurEs  r�test_write_no_dataz/ProactorSocketTransportTests.test_write_no_data�s>��
�
"�
"�
$�
$��
����
�
�
������$�$�$�$�$rc�,�|���}tj��|_tj��|_|�d��|�|jd��|�|jj	��dSrH)
r1rr!�
_write_futrrrsrtrurArCrEs  r�test_write_morez,ProactorSocketTransportTests.test_write_more�sx��
�
"�
"�
$�
$���	����
��9�;�;���
������������W�-�-�-�����)�0�1�1�1�1�1rc�8�|���}td��|_|���|jjj�|jd��|jjjj	j
�|j��dSrH)r1r:rurrrr#�sendr9r)�return_value�add_done_callbackrEs  r�test_loop_writingz.ProactorSocketTransportTests.test_loop_writing�s��
�
"�
"�
$�
$���w�'�'��
�
�������	�� �3�3�D�I�w�G�G�G��	�� �-�?���r�/�0�0�0�0�0r�asyncio.proactor_events.loggerc�`�t��x}|jjj_|���}t
j��|_ddg|_	|�
��|j�|d��d|_|�
d��|�
d��|�
d��|�
d��|�
d��|�|j	d��|j�d��dS)Nsdastaz#Fatal write error on pipe transport�rIzsocket.send() raised exception.)rnrr#r}r]r1rr!r^rurrr9�
_conn_lostrsrt�warning)r,�m_logr`r=s    r�test_loop_writing_errz2ProactorSocketTransportTests.test_loop_writing_err�s��5<�Y�Y�>��d�i�!�&�2�
�
"�
"�
$�
$���)�+�+����U�^��
�
������
��*�*��A�	C�	C�	C���
�
�������
�������
�������
�������
������������T�*�*�*�
�
�(�(�)J�K�K�K�K�Krc��|j���}|�d��|���}||_|�|��|�|j��dSrH)rr3rJr1rzrrr5r;s   r�test_loop_writing_stopz3ProactorSocketTransportTests.test_loop_writing_stop�so���i�%�%�'�'�����w����
�
"�
"�
$�
$����
�
����������"�-�(�(�(�(�(rc��|j���}|�d��|���}||_|���|�|��|�|j��tj	|j��|j
j�d��dS�Nr�)
rr3rJr1rzrrrr5r$r4r'�connection_lostr9r;s   r�test_loop_writing_closingz6ProactorSocketTransportTests.test_loop_writing_closing�s����i�%�%�'�'�����q����
�
"�
"�
$�
$����
�
���
�
�
�
����������"�-�(�(�(���t�y�)�)�)��
�%�8�8��>�>�>�>�>rc��|���}tj��|_|���|j�d��dSr
)r1rr!rk�abortr9rEs  r�
test_abortz'ProactorSocketTransportTests.test_abort�sI��
�
"�
"�
$�
$���)�+�+���
���
�
�
�
��*�*�4�0�0�0�0�0rc�(�|���}|���tj|j��|jj�d��|�|�	����|�
|jd��|jj���|���tj|j��|�
|jjj��dSr�)r1rr$r4rr'r�r9rW�
is_closingrtr��
reset_mockrArCrEs  r�
test_closez'ProactorSocketTransportTests.test_close�s���
�
"�
"�
$�
$��
���
�
�
���t�y�)�)�)��
�%�8�8��>�>�>�����
�
���(�(�(�������*�*�*��
�%�0�0�2�2�2�
���
�
�
���t�y�)�)�)������6�=�>�>�>�>�>rc��|���}tj��|_|���tj|j��|�|j	j
j��dSr
)r1rr!rzrr$r4rrAr'r�rCrEs  r�test_close_write_futz1ProactorSocketTransportTests.test_close_write_fut�sb��
�
"�
"�
$�
$���	����
�
���
�
�
���t�y�)�)�)������6�=�>�>�>�>�>rc���|���}dg|_|���tj|j��|�|jjj	��dSrH)
r1rurr$r4rrAr'r�rCrEs  r�test_close_bufferz.ProactorSocketTransportTests.test_close_buffer�s^��
�
"�
"�
$�
$���Y��
�
���
�
�
���t�y�)�)�)������6�=�>�>�>�>�>rc�0�|���}d|jj_|���tj|j��|jj	�
d��|�|jjj
��dS)N���)r1r)�filenor~rr$r4rr'r�r9rA�shutdownrCrEs  r�test_close_invalid_sockobjz7ProactorSocketTransportTests.test_close_invalid_sockobj�s{��
�
"�
"�
$�
$��(*��	��%�
���
�
�
���t�y�)�)�)��
�%�8�8��>�>�>������+�2�3�3�3�3�3r�asyncio.base_events.loggerc��|���}tj��|_|�d��|�|jj��|�|jj��dSr
)r1rr!rkr^rWrC�error)r,�	m_loggingr=s   r�test_fatal_errorz-ProactorSocketTransportTests.test_fatal_error�sf��
�
"�
"�
$�
$���)�+�+���
������������.�/�/�/����	��.�/�/�/�/�/rc��|���}dg|_tj��x}|_tj��x}|_|�d��|j���|j���tj
|j��|jj
�d��|�d|j��|�|jd��dS)NrIr�)r1rurr!rLrzrk�cancelr9r$r4rr'r�rtr�)r,r=�read_fut�	write_futs    r�test_force_closez-ProactorSocketTransportTests.test_force_closes���
�
"�
"�
$�
$���Y��
�"&�)�+�+�-��2�<�$(�I�K�K�/�	�B�M�
���������*�*�,�,�,���+�+�-�-�-���t�y�)�)�)��
�%�8�8��>�>�>�����r�z�*�*�*�������*�*�*�*�*rc��tj��}|j�|��|j���}|�d��||jj_|�	��}|�
d��|�d��tj
|j��|���dS)Nr�rI)rr!r�set_exception_handlerr3rJr"r}r~r1rsrkr$r4�assert_not_called)r,�exc_handlerr<r=s    r�test_loop_writing_force_closez:ProactorSocketTransportTests.test_loop_writing_force_closes����i�k�k���	�'�'��4�4�4��i�%�%�'�'�����q����*-��
��'�
�
"�
"�
$�
$��
�������
���������t�y�)�)�)��%�%�'�'�'�'�'rc���|���}d|_|�d��tj|j��|�|jjj	��dSrc)
r1rdrkr$r4rrAr'r�rCrEs  r�test_force_close_idempotentz8ProactorSocketTransportTests.test_force_close_idempotent sa��
�
"�
"�
$�
$�����
���������t�y�)�)�)������6�=�>�>�>�>�>rc��|���}dg|_|�d��tj|j��|jj�d��|�	d|j��dSrH)
r1rurkr$r4rr'r�r9rtrEs  r�test_fatal_error_2z/ProactorSocketTransportTests.test_fatal_error_2'sx��
�
"�
"�
$�
$���Y��
�
���������t�y�)�)�)��
�%�8�8��>�>�>�����r�z�*�*�*�*�*rc���|���}|�d��|�|jjj��|�|jjj��dSr
)r1�_call_connection_lostrWr'r�rCr)rrEs  r�test_call_connection_lostz6ProactorSocketTransportTests.test_call_connection_lost0s`��
�
"�
"�
$�
$��
� � ��&�&�&�����
�5�<�=�=�=�����	��.�/�/�/�/�/rc��|���}|�|�����|���|jj�tj��|���|�	|jjj
d��|���dSr�)r1rW�
can_write_eof�	write_eofr)r�r9r(�SHUT_WRrt�
call_countrrEs  r�test_write_eofz+ProactorSocketTransportTests.test_write_eof6s���
�
"�
"�
$�
$������(�(�*�*�+�+�+�
�������	��-�-�f�n�=�=�=�
�����������+�6��:�:�:�
���
�
�
�
�
rc��|���}|j���}||jjj_|�d��|���|�	|j
��|�|jj
j��|jjj�|jd��|�d��|j���|jj
�t$j��|���dS�NrI�)r1rr3�_loopr#r}r~rsr�rW�_eof_writtenrAr)r�rCr9rJ�	_run_oncer(r�r�r,r=�fs   r�test_write_eof_bufferz2ProactorSocketTransportTests.test_write_eof_buffer?s���
�
"�
"�
$�
$���I�#�#�%�%��/0�����,�
�������
�����������(�(�(������+�2�3�3�3�
����2�2�4�9�g�F�F�F�	���Q�����	�������	��-�-�f�n�=�=�=�
���
�
�
�
�
rc��t|j|j|j��}|�|�����|���|�|�����|j���|�|jj	j
��|�	��dSr
)rrr)r'rWr�r�r�r�rrCrEs  r�test_write_eof_write_pipez6ProactorSocketTransportTests.test_write_eof_write_pipeMs���
(��I�t�y�$�-�1�1������(�(�*�*�+�+�+�
����������
�
���(�(�(��	����������	��.�/�/�/�
���
�
�
�
�
rc���t|j|j|j��}|j���}||jjj_|�	d��|�
��|�|�����|�
|jjj��|jjj�|jd��|�d��|j���|j���|�|jjj��|���dSr�)rrr)r'r3r�r#r}r~rsr�rWr�rAr�rCr9rJr�rr�s   r� test_write_eof_buffer_write_pipez=ProactorSocketTransportTests.test_write_eof_buffer_write_pipeWs��
(���D�I�t�}�
M�
M���I�#�#�%�%��/0�����,�
�������
����������
�
���(�(�(������+�2�3�3�3�
����2�2�4�9�g�F�F�F�	���Q�����	�������	����������	��.�/�/�/�
���
�
�
�
�
rc�>�t|j|j|j��}|�|�����|�t��5|���ddd��n#1swxYwYt|��dSr
)
rrr)r'rAr�rU�NotImplementedErrorr�rrEs  r�test_write_eof_duplex_pipez7ProactorSocketTransportTests.test_write_eof_duplex_pipefs���
)��I�t�y�$�-�1�1������)�)�+�+�,�,�,�
�
�
�2�
3�
3�	�	��L�L�N�N�N�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�������s�"B�B�
Bc���������}d}gd�}tt|�������fd�}|�jjj_�j�����|j	����
|�����|dd�D]G}�j����jj
�t|�����H|���|�����
|j	����|�����t#d��D]}�j�����jj
�t|d����|���|�����|j	����
|�����|dd�D]G}�j����jj
�t|�����H|���|���t'j���j_�j����jj����jj
�t|d����|�����|�����dS)Nr)�data1�data2sdata3sdata4sdata5rc��������j���}�����|j����fd�}||_|�t�����|S)Nc�@����dt����<���Sr
)rK)rq�msgr6s���r�monkeyzYProactorSocketTransportTests.test_pause_resume_reading.<locals>.recv_into.<locals>.monkeyys!���"%��Y�c�#�h�h�Y���v�x�x�r)rr3�popr6rJrK)r)rqr�r�r�r6�
reversed_msgsr,s `  @@��rr8zIProactorSocketTransportTests.test_pause_resume_reading.<locals>.recv_intotsz�������	�'�'�)�)�A��#�#�%�%�C��X�F�
 �
 �
 �
 �
 �
 �
 ��A�H�
�L�L��S���"�"�"��Hr��
r�r�)r1�list�reversedrr#r8r]r�rA�_pausedrW�
is_readingr'rBr9r:�
pause_reading�range�resume_readingrr!�call_exception_handlerr�r)r,r=�index�msgsr8r��ir�s`      @r�test_pause_resume_readingz6ProactorSocketTransportTests.test_pause_resume_readingns�����
�
"�
"�
$�
$����F�F�F���X�d�^�^�,�,�
�	�	�	�	�	�	�5>��	��%�1��	�����������$�$�$�����
�
���(�(�(�����8�	K�	K�C��I���!�!�!��M�'�:�:�9�S�>�>�J�J�J�J�
������
����������
�#�#�#���������)�)�)��r���	"�	"�A��I���!�!�!�!��
�#�6�6�y��a��7I�7I�J�J�J�
������
�����������$�$�$�����
�
���(�(�(���!��9�	K�	K�C��I���!�!�!��M�'�:�:�9�S�>�>�J�J�J�J�
������
������+/�9�;�;��	�(��	�������	�(�:�:�<�<�<��
�#�6�6�y��a��7I�7I�J�J�J�
���
�
�
���������)�)�)�)�)rc�:�|���}|�|���|�|���d��|�|jjj��|�|jjj��|S)N��highr)	r1�set_write_buffer_limitsrt�get_write_buffer_sizerAr'�
pause_writingrC�resume_writing)r,r�r=s   r�pause_writing_transportz4ProactorSocketTransportTests.pause_writing_transport�s���
�
"�
"�
$�
$��
�"�"��"�-�-�-�����1�1�3�3�Q�7�7�7������4�;�<�<�<������5�<�=�=�=��	rc�(�|�d���}|j���}||jjj_|�d��|j���|�|j	j
j��|�d��|j���|�
|���d��|�|j	jj��dS)Nr�r�s
large datar)r�rr3r#r}r~rsr�rWr'r�rCrJrtr�r��r,r=r<s   r�test_pause_resume_writingz6ProactorSocketTransportTests.test_pause_resume_writing�s���
�
)�
)�q�
)�
1�
1���i�%�%�'�'��03��	�� �-�
��������	����������
�3�:�;�;�;�	���t�����	����������1�1�3�3�Q�7�7�7�����
�4�;�<�<�<�<�<rc�x�|�d���}|j���}||jjj_|�d��|j���|�|�	��d��|�
|jjj
��|�d��|j���|�|�	��d��|�|jjj
��dS)Nr�r�s123��abc��r�rr3r#r}r~rsr�rtr�rAr'r�rCrW)r,r=�fut1s   r�test_pause_writing_2writez6ProactorSocketTransportTests.test_pause_writing_2write�s��
�
)�
)�q�
)�
1�
1���y�&�&�(�(��04��	�� �-�
��������	����������1�1�3�3�Q�7�7�7������4�;�<�<�<�	��������	����������1�1�3�3�Q�7�7�7�����
�3�:�;�;�;�;�;rc�l�|�d���}|j���}||jjj_|�d��|j���|�|�	��d��|�
|jjj
��|�d��|j���|�|�	��d��|�
|jjj
��|�d��|j���|�|�	��d��|�|jjj
��dS)	Nr�r��1r�s23r�r�r�r�r�s   r�test_pause_writing_3writez6ProactorSocketTransportTests.test_pause_writing_3write�sk��
�
)�
)�q�
)�
1�
1���i�%�%�'�'��03��	�� �-�
��������	����������1�1�3�3�Q�7�7�7������4�;�<�<�<�	��������	����������1�1�3�3�Q�7�7�7������4�;�<�<�<�	��������	����������1�1�3�3�Q�7�7�7�����
�3�:�;�;�;�;�;rc��|�d���}|j���}|�d��||jjj_|�d��|j���|�	|�
��d��|�|jj
j��dS)Nr�r�svery large datar)r�rr3rJr#r}r~rsr�rtr�rAr'r�rCr�s   r�test_dont_pause_writingz4ProactorSocketTransportTests.test_dont_pause_writing�s���
�
)�
)�q�
)�
1�
1���i�%�%�'�'�����t����03��	�� �-�
���#�$�$�$��	����������1�1�3�3�Q�7�7�7������4�;�<�<�<�<�<rr
)3�__name__�
__module__�__qualname__rr1r>rFrQ�unittest�skipIf�sys�flags�optimizerYrarerhrlrorvrxr{r�r�patchr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__�r-s@rrr!s��������!�!�!�!�!�����[�[�[�<�<�<�G�G�G��X�_�S�Y�'�)T�U�U�)�)�V�U�)�B�B�B�1�1�1�0�0�0�	0�	0�	0�B�B�B�:�:�:�%�%�%�
2�2�2�1�1�1��T�Z�0�1�1�L�L�2�1�L�&)�)�)�
?�
?�
?�1�1�1�?�?�?�?�?�?�?�?�?�4�4�4��T�Z�,�-�-�0�0�.�-�0�+�+�+�(�(�(�?�?�?�+�+�+�0�0�0����������
�
�
����5*�5*�5*�p���=�=�=� <�<�<�"<�<�<�.=�=�=�=�=�=�=rrc����eZdZ�fd�Zdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zej
d��d���Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zej
d��d���Z�xZS)�ProactorDatagramTransportTestsc�|��t�����|���|_t	j��|_|j|j_tj	tj��|_t	jtj
���|_d|jj_dS)N)�spec_set�)rrrrrr!r"r#r$r%r�DatagramProtocolr'r(r)r�r~r+s �rrz$ProactorDatagramTransportTests.setUp�s~���
���
�
�����&�&�(�(��	��	����
�"�m��	��"�5�g�6N�O�O��
��I�v�}�5�5�5��	�()��	��%�%�%rNc��|rdnt|jj_t	|j|j|j|���}|�t|��|S)N��address)	rnr)�getpeernamer]rrr'r r)r,rrs   r�datagram_transportz1ProactorDatagramTransportTests.datagram_transports[��4;�,H�D�D���	��)�.�t�y�$�)�/3�}�7>�@�@�@�	�	
�����3�3�3��rc���d}|���}|�|d��|�|jjj��|jj�|j|d���dS�NrI)�0.0.0.0i���addr)r
�sendtorWr"rCr9r)�r,rqrs   r�test_sendtoz*ProactorDatagramTransportTests.test_sendtos�����+�+�-�-�	�����0�1�1�1�����
�,�3�4�4�4��
��/�/��I�t�"3�	0�	5�	5�	5�	5�	5rc��td��}|���}|�|d��|�|jjj��|jj�|jdd���dSr)r:r
rrWr"rCr9r)rs   r�test_sendto_bytearrayz4ProactorDatagramTransportTests.test_sendto_bytearrays�����!�!���+�+�-�-�	�����0�1�1�1�����
�,�3�4�4�4��
��/�/��I�w�%6�	0�	8�	8�	8�	8�	8rc��td��}|���}|�|d��|�|jjj��|jj�|jdd���dSr)�
memoryviewr
rrWr"rCr9r)rs   r�test_sendto_memoryviewz5ProactorDatagramTransportTests.test_sendto_memoryviews����'�"�"���+�+�-�-�	�����0�1�1�1�����
�,�3�4�4�4��
��/�/��I�w�%6�	0�	8�	8�	8�	8�	8rc�(�|���}|j�d��|�dd��|�|jjj��|�dgt|j����dS)N)rI�ri90rr)	r
ru�appendrrAr)rCrtr��r,rs  r�test_sendto_no_dataz2ProactorDatagramTransportTests.test_sendto_no_data s����+�+�-�-�	��� � �!>�?�?�?�����b�!�!�!������)�0�1�1�1����
*�+�T�)�2C�-D�-D�	F�	F�	F�	F�	Frc�P�|���}|j�d��t��|_|�dd��|�|jjj��|�	ddgt|j����dS)N�r�rr�r�r�r)r
rur�objectrzrrAr"rCrtr�rs  r�test_sendto_bufferz1ProactorDatagramTransportTests.test_sendto_buffer(s����+�+�-�-�	��� � �!?�@�@�@�%�x�x�	������#5�6�6�6������-�4�5�5�5����
+�
+�
-���"�#�#�	%�	%�	%�	%�	%rc���td��}|���}|j�d��t	��|_|�|d��|�|jjj	��|�
ddgt|j����|�|jddt��dS�Nr�r!rr"r�r)r:r
rurr#rzrrAr"rCrtr��assertIsInstance�bytes�r,�data2rs   r�test_sendto_buffer_bytearrayz;ProactorDatagramTransportTests.test_sendto_buffer_bytearray3s����(�#�#���+�+�-�-�	��� � �!?�@�@�@�%�x�x�	������ 2�3�3�3������-�4�5�5�5����
+�
+�
-���"�#�#�	%�	%�	%�	
���i�/��2�1�5�u�=�=�=�=�=rc���td��}|���}|j�d��t	��|_|�|d��|�|jjj	��|�
ddgt|j����|�|jddt��dSr&)rr
rurr#rzrrAr"rCrtr�r'r(r)s   r�test_sendto_buffer_memoryviewz<ProactorDatagramTransportTests.test_sendto_buffer_memoryview@s����8�$�$���+�+�-�-�	��� � �!?�@�@�@�%�x�x�	������ 2�3�3�3������-�4�5�5�5����
+�
+�
-���"�#�#�	%�	%�	%�	
���i�/��2�1�5�u�=�=�=�=�=rr�c�b�d}t��x}|jj_|���}tj��|_|�|d��|�|jj	��|j�
|d��d|_d|_|�|��|�|��|�|��|�|��|�|��|j
�
d��dS)NrIr�'Fatal write error on datagram transportr�)�123z!socket.sendto() raised exception.)�RuntimeErrorr"rr]r
rr!r^rWrCr9r��_addressr�)r,r�rqr`rs     r�test_sendto_exceptionz4ProactorDatagramTransportTests.test_sendto_exceptionMs!����1=���?��d�m�"�.��+�+�-�-�	�!%����	������r�"�"�"����	�.�5�6�6�6���1�1�#&�#L�	N�	N�	N� !�	��%�	�������������������������������������
�
�(�(�)L�M�M�M�M�Mrc�.�d}t|jj_|���}tj��|_|�|d��|�|j	d��|�
|jj��dS)NrIrr)�ConnectionRefusedErrorr)rr]r
rr!r^rtr�rArCrs   r�test_sendto_error_receivedz9ProactorDatagramTransportTests.test_sendto_error_receivedds�����'=��	��$��+�+�-�-�	�!%����	������r�"�"�"�����-�q�1�1�1�����/�6�7�7�7�7�7rc�B�d}t|jj_|�d���}tj��|_|�|��|�	|jj
��|�|jj
j
��dS)NrI�rr�r
)r5r"r}r]r
rr!r^rrArCrWr'�error_receivedrs   r�$test_sendto_error_received_connectedzCProactorDatagramTransportTests.test_sendto_error_received_connectedps�����)?��
��&��+�+�N�+�C�C�	�!%����	�������������/�6�7�7�7�����
�4�;�<�<�<�<�<rc�r�|���}|�t|jdd��dS)N�strr)r
rU�	TypeErrorrrs  r�test_sendto_strz.ProactorDatagramTransportTests.test_sendto_str|s6���+�+�-�-�	����)�Y�%5�u�b�A�A�A�A�Arc�v�|�d���}|�t|jdd��dS)Nr8r
sstr)rr�)r
rU�
ValueErrorrrs  r�test_sendto_connected_addrz9ProactorDatagramTransportTests.test_sendto_connected_addr�sK���+�+�N�+�C�C�	�����	�(�&�.�	B�	B�	B�	B�	Brc���|�d���}|���|�|jd��|�dd��|�|jd��dS)N)r�r
r�rIr�)r
rrtr�rrs  r�test_sendto_closingz2ProactorDatagramTransportTests.test_sendto_closing�sv���+�+�D�+�9�9�	�����������-�q�1�1�1�����$�'�'�'�����-�q�1�1�1�1�1rc�D�|���}d|_|���|�|j��tj|j��|jj	�
��|jj�
d��dSrc)
r
rdrrr5rzr$r4rr)rr9r'r�rs  r�test__loop_writing_closingz9ProactorDatagramTransportTests.test__loop_writing_closing�s����+�+�-�-�	�!�	�����!�!�!����)�.�/�/�/���t�y�)�)�)��	��*�*�,�,�,��
�%�8�8��>�>�>�>�>rc�.�t��x}|jj_|���}tj��|_|j�	d��|�
��|j�|d��dS)N�rIrr/)r1r"rr]r
rr!r^rurrrr9)r,r`rs   r�test__loop_writing_exceptionz;ProactorDatagramTransportTests.test__loop_writing_exception�s���1=���?��d�m�"�.��+�+�-�-�	�!%����	���� � ��/�/�/����!�!�!���1�1�#&�#L�	N�	N�	N�	N�	Nrc�$�t|jj_|���}tj��|_|j�	d��|�
��|�|jj��dS)NrG)
r5r"rr]r
rr!r^rurrrrArCrs  r�!test__loop_writing_error_receivedz@ProactorDatagramTransportTests.test__loop_writing_error_received�sw��+A��
��(��+�+�-�-�	�!%����	���� � ��/�/�/����!�!�!�����/�6�7�7�7�7�7rc�p�t|jj_|�d���}tj��|_|j�	d��|�
��|�|jj��|�
|jjj��dS)Nr8r
rG)r5r"r}r]r
rr!r^rurrrrArCrWr'r9rs  r�,test__loop_writing_error_received_connectionzKProactorDatagramTransportTests.test__loop_writing_error_received_connection�s���)?��
��&��+�+�N�+�C�C�	�!%����	���� � ��/�/�/����!�!�!�����/�6�7�7�7�����
�4�;�<�<�<�<�<rz asyncio.base_events.logger.errorc���|�d���}t��}|�|��|�|jjj��|���dS)Nr8r
)r
r5r^rAr'r9rCr�)r,�m_excrr`s    r�test_fatal_error_connectedz9ProactorDatagramTransportTests.test_fatal_error_connected�sk���+�+�N�+�C�C�	�$�&�&�����s�#�#�#������5�<�=�=�=�
���!�!�!�!�!rr
)r�r�r�rr
rrrrr$r+r-rrr3r6r:r>rArCrErHrJrLrOrrs@rrr�s��������*�*�*�*�*�����5�5�5�8�8�8�8�8�8�F�F�F�	%�	%�	%�>�>�>�>�>�>��T�Z�0�1�1�N�N�2�1�N�,
8�
8�
8�
=�
=�
=�B�B�B�B�B�B�
2�2�2�?�?�?�
N�
N�
N�8�8�8�	=�	=�	=��T�Z�2�3�3�"�"�4�3�"�"�"�"�"rrc�0��eZdZ�fd�Zejd��d���Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zejd��d
���Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zejejjd��d���Zd�Zd�Z�xZS)�BaseProactorEventLoopTestsc�<��t�����tj��|_tj��|_tj��tj��c|_|_	tj
d|j|j	f���5tj
d��5t|j��|_ddd��n#1swxYwYddd��n#1swxYwY|�
|j��dS)N�)asyncio.proactor_events.socket.socketpair)r~�signal.set_wakeup_fd)rrr$�mock_nonblocking_socketr)rr!r"�ssock�csockrrr�set_event_loopr+s �rrz BaseProactorEventLoopTests.setUp�s���
���
�
�����6�8�8��	��	����
�!%����d�i�k�k���
�D�J�
�Z�C�&*�j�$�*�%=�?�?�?�	A�	A���2�3�3�
A�
A�1�$�-�@�@��	�
A�
A�
A�
A�
A�
A�
A�
A�
A�
A�
A����
A�
A�
A�
A�	A�	A�	A�	A�	A�	A�	A�	A�	A�	A�	A����	A�	A�	A�	A�	
���D�I�&�&�&�&�&s6�%C7�:C �C7� C$	�$C7�'C$	�(C7�7C;�>C;rSc��tj��tj��fx\}}|_tjd��5t	|j��}ddd��n#1swxYwY|�|j|��|�|j|��|�	|j
d��|���dS)NrTr�)rr!r~rrr"�assertIs�_ssock�_csockrt�
_internal_fdsr)r,�
socketpairrVrWrs     rr>z$BaseProactorEventLoopTests.test_ctor�s���
�I�K�K�����2&�	&���u�z�.�
�Z�.�
/�
/�	8�	8�(���7�7�D�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8��
�
�d�k�5�)�)�)��
�
�d�k�5�)�)�)�����+�Q�/�/�/��
�
�����s�A&�&A*�-A*c��|j���|�|jjd��|�|jjj��|�|jjj��|�	|jj
��|�	|jj��d|j_dS)NrT)
r�_close_self_pipertr]rWrVrrCrWr5r[r\�_closed�r,s r�test_close_self_pipez/BaseProactorEventLoopTests.test_close_self_pipe�s����	�"�"�$�$�$������0�!�4�4�4�����
�(�/�0�0�0�����
�(�/�0�0�0����$�)�*�+�+�+����$�)�*�+�+�+�!��	���rc��tj��|j_|j���|�|jjj��|�|jjj��|�|jj	��|jj�
��|j���|�|jjj��dSr
)rr!rr`rrWrCr"r5r#r�rArbs rr�z%BaseProactorEventLoopTests.test_close�s���%)�Y�[�[��	�"��	����������	�2�9�:�:�:�����
�+�2�3�3�3����$�)�-�.�.�.��	�"�-�-�/�/�/��	�����������3�:�;�;�;�;�;rc��|j�|jtj����}|�|t��t|��dSr
)r�_make_socket_transportr)rr&r'rrrEs  r�test_make_socket_transportz5BaseProactorEventLoopTests.test_make_socket_transport�sO��
�Y�
-�
-�d�i��9I�9K�9K�
L�
L�����b�":�;�;�;�������rc���|j���|jj�|jd��|jjjj�|jj��dS�Ni)r�_loop_self_readingr"�recvr9rVr~rrbs r�test_loop_self_readingz1BaseProactorEventLoopTests.test_loop_self_reading�sh���	�$�$�&�&�&��
��-�-�d�j�$�?�?�?��
��'�9�L�L��I�(�	*�	*�	*�	*�	*rc�f�tj��}||j_|j�|��|�|jj��|jj	�
|jd��|jj	jj
�
|jj��dSri)rr!r�_self_reading_futurerjrWr6rCr"rkr9rVr~r)r,r<s  r�test_loop_self_reading_futz5BaseProactorEventLoopTests.test_loop_self_reading_fut�s����i�k�k��),��	�&��	�$�$�S�)�)�)�����
�)�*�*�*��
��-�-�d�j�$�?�?�?��
��'�9�L�L��I�(�	*�	*�	*�	*�	*rc���tj��|j_t	��|jj_|j���|�	|jjj
��dSr
)rr!rr�rnr"rkr]rjrWrCrbs r� test_loop_self_reading_exceptionz;BaseProactorEventLoopTests.test_loop_self_reading_exceptionsW��+/�9�;�;��	�(�)0����
��&��	�$�$�&�&�&�����	�8�?�@�@�@�@�@rc�v�|j���|jj�d��dS)N�)r�_write_to_selfrWr}r9rbs r�test_write_to_selfz-BaseProactorEventLoopTests.test_write_to_self
s4���	� � �"�"�"��
��*�*�5�1�1�1�1�1rc�:�|j�g��dSr
)r�_process_eventsrbs r�test_process_eventsz.BaseProactorEventLoopTests.test_process_eventss���	�!�!�"�%�%�%�%�%rr�c�x�tj��}tj��x}|j_|j�||j��|�|j��|jdd}|��|j	j
�|j��tj��}tj��tj��f|j_
tj��x}|j_||��|�|jj��|�|j��t��|j_||��|�|jjj��|�|jj��dSrT)rr!r�	call_soon�_start_servingr)rWrC�	call_argsr"�acceptr9r6r~rfrnr]rr�)r,r��pfrzrr<�make_trs       r�test_create_serverz-BaseProactorEventLoopTests.test_create_serversS��
�Y�[�[��*.�)�+�+�5�	�D�I�'��	� � ��T�Y�/�/�/����	�(�)�)�)��"�1�%�a�(��������
��/�/��	�:�:�:��i�k�k��#'�9�;�;��	���"<��
��59�Y�[�[�@��$�)�2���S�	�	�	�����
�)�*�*�*������'�'�'�")����
����S�	�	�	�����	��.�/�/�/������*�+�+�+�+�+rc��tj��}tj��x}|j_|j�||j��|jdd}|j���}|���||��|�	|jj
j��dSrT)rr!rrzr{r)r|r3r�rWrrC)r,r~rzrr<s     r�test_create_server_cancelz4BaseProactorEventLoopTests.test_create_server_cancel-s���
�Y�[�[��*.�)�+�+�5�	�D�I�'��	� � ��T�Y�/�/�/��"�1�%�a�(���i�%�%�'�'���
�
������S�	�	�	�����	��.�/�/�/�/�/rc�p�tj��}tj��}tj��}tj��}|���||���|i|j_|j�|��|�|jj��|�|j	j��|j
j�|��|�|jj��|�|j	j��dSr
)
rr!r�r�_accept_futures�
_stop_servingrWrrCr�r"r9rA)r,�sock1�future1�sock2�future2s     r�test_stop_servingz,BaseProactorEventLoopTests.test_stop_serving:s����	�����)�+�+���	�����)�+�+���L�L�N�N�G��L�L�N�N�G�%
��	�!�
	
�	����&�&�&������*�+�+�+������-�.�.�.��
�#�6�6�u�=�=�=������+�,�,�,������.�/�/�/�/�/rc��tjtj��|_|j�|j|j��Sr
)r$r%rrr'r�_make_datagram_transportr)rbs rr
z-BaseProactorEventLoopTests.datagram_transportKs3��"�5�g�6N�O�O��
��y�1�1�$�)�T�]�K�K�Krc���|���}|�|t��|�|tj��t|��dSr
)r
r'rr�DatagramTransportrrEs  r�test_make_datagram_transportz7BaseProactorEventLoopTests.test_make_datagram_transportOsW��
�
$�
$�
&�
&�����b�"<�=�=�=����b�'�";�<�<�<�������rc�f�|���}|j�d��|���|jjj�|jdd���|jjjj	j
�|j��t|��dS)N�rI��	127.0.0.1i$/rIr�r)r
ru�
appendleftrrrr#rr9r)r~rrrEs  r�test_datagram_loop_writingz5BaseProactorEventLoopTests.test_datagram_loop_writingUs���
�
$�
$�
&�
&��
�
���=�>�>�>�
�������	��"�5�5�d�i��Oc�5�d�d�d��	��"�/�A���r�/�0�0�0�������rc�X�|���}|���|jjj�|jd��|�|jj	j
��|�|jjj
��t|��dS)N�)
r
r@rr#�recvfromr9r)rAr'�datagram_receivedrCr9rrEs  r�test_datagram_loop_readingz5BaseProactorEventLoopTests.test_datagram_loop_reading_s���
�
$�
$�
&�
&��
�������	��$�7�7��	�:�N�N�N������8�?�@�@�@������5�<�=�=�=�������rc�t�|j���}|�d��|���}||_|�|��|jjj�|j	d��|j
j�dd��t|��dS)Nr�r�rIr�)
rr3rJr
rLr@r#r�r9r)r'r�rrXs   r�test_datagram_loop_reading_dataz:BaseProactorEventLoopTests.test_datagram_loop_reading_datags����i�%�%�'�'�����6�7�7�7�
�
$�
$�
&�
&�����
��������	��$�7�7��	�:�N�N�N��
�'�:�:�7�DX�Y�Y�Y�������rrRc�*�|j���}|�d��|���}|�t
|j|��tj��|_	||_
|�|��|�|jjj
j��|�|jjj��|�|j	j��t%|��dS)N)rr�)rr3rJr
rUrVr@rr!rrLrWr#r�rCrAr'r9rrXs   r�"test_datagram_loop_reading_no_dataz=BaseProactorEventLoopTests.test_datagram_loop_reading_no_datars����i�%�%�'�'�����2�3�3�3�
�
$�
$�
&�
&�����.�"�*:�C�@�@�@��9�;�;������
�����������	�+�4�;�<�<�<������5�<�=�=�=�������)�)�)�������rc�d�t��x}|jjj_|���}t
j��|_t
j��|j	_
|���|j	j
�|��t|��dSr
)r\rr#r�r]r
rr!r^�	_protocolr9r@r9rr_s   r�"test_datagram_loop_reading_abortedz=BaseProactorEventLoopTests.test_datagram_loop_reading_aborted�s���9O�9Q�9Q�Q��d�i�!�*�6�
�
$�
$�
&�
&���)�+�+���&*�i�k�k���#�
������
��#�6�6�s�;�;�;�������rc��t��x}|jjj_|���}t
j��|_t
j��|j	_
|j�d��|�
��|j	j
�|��t|��dS)N)sHellor�)r\rr#rr]r
rr!r^r�r9rur�rrr9rr_s   r�"test_datagram_loop_writing_abortedz=BaseProactorEventLoopTests.test_datagram_loop_writing_aborted�s���7M�7O�7O�O��d�i�!�(�4�
�
$�
$�
&�
&���)�+�+���&*�i�k�k���#�
�
���>�?�?�?�
������
��#�6�6�s�;�;�;�������r) r�r�r�rrrr>rcr�rgrlrorqrurxr�r�r�r
r�r�r�r�r�r�r�r�r�r�r�r�rrs@rrQrQ�s��������'�'�'�'�'��T�Z�;�<�<���=�<��	!�	!�	!�	<�	<�	<����
*�*�*�*�*�*�A�A�A�2�2�2�&�&�&��T�Z�,�-�-�,�,�.�-�,�60�0�0�0�0�0�"L�L�L����������	�	�	��X�_�S�Y�'�)T�U�U�
�
�V�U�
����	�	�	�	�	�	�	rrQ�win32z%Proactor is supported on Windows onlyc���eZdZddzZGd�dej��Ze�fd���Ze�fd���Z	�fd�Z
dd	�Zd
�Zd�Z
d�Zd
�Zd�Z�xZS)�&ProactorEventLoopUnixSockSendfileTestss�12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde�c�,�eZdZd�Zd�Zd�Zd�Zd�ZdS)�.ProactorEventLoopUnixSockSendfileTests.MyProtoc��d|_d|_t��|_|���|_d|_dSrg)�started�closedr:rqr3r<r)r,rs  r�__init__z7ProactorEventLoopUnixSockSendfileTests.MyProto.__init__�s9�� �D�L��D�K�!���D�I��)�)�+�+�D�H�!�D�N�N�Nrc�"�d|_||_dSrc)r�rrs  rr7z>ProactorEventLoopUnixSockSendfileTests.MyProto.connection_made�s���D�L�&�D�N�N�Nrc�:�|j�|��dSr
)rq�extend)r,rqs  rrBz<ProactorEventLoopUnixSockSendfileTests.MyProto.data_received�s���I���T�"�"�"�"�"rc�H�d|_|j�d��dSrc)r�r<rJ)r,�excs  rr�z>ProactorEventLoopUnixSockSendfileTests.MyProto.connection_lost�s%���D�K��H����%�%�%�%�%rc��$K�|j�d{V��dSr
)r<rbs r�wait_closedz:ProactorEventLoopUnixSockSendfileTests.MyProto.wait_closed�s�����(�N�N�N�N�N�N�N�N�NrN)r�r�r�r�r7rBr�r�rrr�MyProtor��s_������	"�	"�	"�	'�	'�	'�	#�	#�	#�	&�	&�	&�	�	�	�	�	rr�c����ttjd��5}|�|j��ddd��n#1swxYwYt�����dS)N�wb)�openr	�TESTFNrs�DATAr�
setUpClass)�cls�fpr-s  �rr�z1ProactorEventLoopUnixSockSendfileTests.setUpClass�s����
�)�"�D�
)�
)�	�R��H�H�S�X����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
���������s�A�A�
Ac���tjtj��t�����dSr
)r	�unlinkr�r�
tearDownClass)r�r-s �rr�z4ProactorEventLoopUnixSockSendfileTests.tearDownClass�s3������)�*�*�*�
���������rc�f��tj��|_|�|j��|�|jj��t
tjd��|_	|�|j	j��t�����dS)N�rb)r�ProactorEventLooprrXr rr�r	r��filerrr+s �rrz,ProactorEventLoopUnixSockSendfileTests.setUp�s~����-�/�/��	����D�I�&�&�&�����	��(�(�(���)�4�0�0��	�����	��(�(�(�
���
�
�����rTc�f�tjtjtj��}|�d��|�tjtjd��|�tjtjd��|r|�|j	��|S)NFr�)
r(�AF_INET�SOCK_STREAM�setblocking�
setsockopt�
SOL_SOCKET�	SO_SNDBUF�	SO_RCVBUFr r)r,�cleanupr)s   r�make_socketz2ProactorEventLoopUnixSockSendfileTests.make_socket�s����}�V�^�V�-?�@�@�������������)�6�+;�T�B�B�B�����)�6�+;�T�B�B�B��	(��O�O�D�J�'�'�'��rc�6�|j�|��Sr
)r�run_until_complete)r,�coros  r�run_loopz/ProactorEventLoopUnixSockSendfileTests.run_loop�s���y�+�+�D�1�1�1rc���������}���j���tj��}��d���}|�d|f�����j��fd�|���������j�||�	���������fd�}��
|��|�fS)NF)r�r�c����Sr
r)�protos�r�<lambda>z@ProactorEventLoopUnixSockSendfileTests.prepare.<locals>.<lambda>�s���E�r)r)c����j�@�j�����������������������dSr
)rrr�r�)r�r,�servers���rr�z?ProactorEventLoopUnixSockSendfileTests.prepare.<locals>.cleanup�sr�����
3���%�%�'�'�'��
�
�e�/�/�1�1�2�2�2��L�L�N�N�N��M�M�&�,�,�.�.�/�/�/�/�/r)r�r�rr
�find_unused_port�bindr��
create_server�sock_connect�getsocknamer )r,r)�port�srv_sockr�r�r�s`    @@r�preparez.ProactorEventLoopUnixSockSendfileTests.prepare�s��������!�!�����T�Y�'�'���-�/�/���#�#�E�#�2�2���
�
�{�D�)�*�*�*����t�y�6�6��M�M�M�� 7� *� *�+�+���
�
�d�i�,�,�T�8�3G�3G�3I�3I�J�J�K�K�K�	0�	0�	0�	0�	0�	0�	0�	
���� � � ��U�{�rc	�z�|���\}}t��}|�tjd��5|�|j�||dd����ddd��n#1swxYwY|�|j	�
��d��dS�N�not a regular filer)r�r#�assertRaisesRegexr�SendfileNotAvailableErrorr�r�_sock_sendfile_nativertr��tell�r,r)r�r�s    r�test_sock_sendfile_not_a_filezDProactorEventLoopUnixSockSendfileTests.test_sock_sendfile_not_a_file�s���l�l�n�n���e��H�H��
�
#�
#�G�$E�$8�:�:�	D�	D��M�M�$�)�9�9�$��:;�T�C�C�
D�
D�
D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D����	D�	D�	D�	D�	
�������)�)�1�-�-�-�-�-s�1B�B�
Bc	��|���\}}tj��}|�tjd��5|�|j�||dd����ddd��n#1swxYwY|�	|j
���d��dSr�)r��io�BytesIOr�rr�r�rr�rtr�r�r�s    r�test_sock_sendfile_iobufferzBProactorEventLoopUnixSockSendfileTests.test_sock_sendfile_iobuffer�s���l�l�n�n���e��J�L�L��
�
#�
#�G�$E�$8�:�:�	D�	D��M�M�$�)�9�9�$��:;�T�C�C�
D�
D�
D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D����	D�	D�	D�	D�	
�������)�)�1�-�-�-�-�-s�1B�B�Bc	��|���\}}tj��}d|j_|�tjd��5|�|j	�
||dd����ddd��n#1swxYwY|�|j�
��d��dS)Nr�r�r)r�rr!r�r~r�rr�r�rr�rtr�r�r�s    r�#test_sock_sendfile_not_regular_filezJProactorEventLoopUnixSockSendfileTests.test_sock_sendfile_not_regular_file�s���l�l�n�n���e��I�K�K�� "����
�
#�
#�G�$E�$8�:�:�	D�	D��M�M�$�)�9�9�$��:;�T�C�C�
D�
D�
D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D����	D�	D�	D�	D�	
�������)�)�1�-�-�-�-�-s�1B�B�B)T)r�r�r�r�rr&r��classmethodr�r�rr�r�r�r�r�r�rrs@rr�r��s���������$�D������'�"����.������[��
� � � � ��[� ����������2�2�2����0.�.�.�.�.�.�.�.�.�.�.�.�.rr��__main__)�__doc__r�r(r�r�rr�asyncio.proactor_eventsrrrrr�test.supportr	r
�test.test_asynciorr$rr�TestCaserrrQr��platformr�r��mainrrr�<module>r�s#��"�"�	�	�	�	�
�
�
�
�����
�
�
�
�����������9�9�9�9�9�9�<�<�<�<�<�<�?�?�?�?�?�?�@�@�@�@�@�@�>�>�>�>�>�>�"�"�"�"�"�"�&�&�&�&�&�&�1�1�1�1�1�1�(�(�(����Q=�Q=�Q=�Q=�Q=�:�#6�Q=�Q=�Q=�hG"�G"�G"�G"�G"�Z�%8�G"�G"�G"�TV�V�V�V�V��!4�V�V�V�r������(�8�:�:�k.�k.�k.�k.�k.�Z�-@�k.�k.�:�:�k.�\�z����H�M�O�O�O�O�O��r