403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.51
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python313/Lib/test/test_asyncio/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/test_asyncio/__pycache__/test_base_events.cpython-313.pyc
�

��i�V���SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSK
Jr SSKrSSKJ
r
 SSKJr SSKJr SSKJr SSKJr SS	KJr SS
KJr SSKr\R4r"SS\5rS
rSrSr "SS\RB5r""SS\RB5r#"SS\RH5r%"SS\RL5r'"SS\RB5r("SS\
RB5r)"SS\RB5r*"SS\RB5r+\,S :Xa\
RZ"5 gg)!zTests for base_events.py�N)�mock)�base_events)�	constants)�utils)�support)�assert_python_ok)�	os_helper)�
socket_helperc��\rSrSrSrg)�CustomError��N��__name__�
__module__�__qualname__�__firstlineno__�__static_attributes__r��7C:\Python313\\Lib\test\test_asyncio\test_base_events.pyrrs��rrc�0�[R"S5 g�N)�asyncio�set_event_loop_policyrrr�tearDownModulers���!�!�$�'rc	�<�[R"[S9nSH?n[[U5(a[	X[[U55 M4[
X5 MA [R"5Ul[R"5URl	U$)N)�spec)
�AF_INET�AF_INET6�	AF_UNSPEC�IPPROTO_TCP�IPPROTO_UDP�SOCK_STREAM�
SOCK_DGRAM�
SOL_SOCKET�SO_REUSEADDR�	inet_pton)
r�	MagicMock�socket�hasattr�setattr�getattr�delattr�
test_utils�mock_nonblocking_socket�return_value)�m_socket�names  r�mock_socket_moduler3#sn���~�~�6�*�H����6�4� � ��H�G�F�D�$9�:��H�#���n�n�&�H�O�#-�#E�#E�#G�H�O�O� ��Orc�@�[R"S[S9"U5$)Nzasyncio.base_events.socket)�new_callable)r�patchr3)�fs r�patch_socketr84s!���:�:�2�#5�7�78�:�:rc�0�\rSrSrSrSr\S5rSrg)�BaseEventTests�9c
�"�[Rn[Rn[Rn[Rn[R
n[Rn[RnURX$USS4[R"SSX$U55 URX$USS4[R"SSX$U55 URX$USS4[R"SSXU55 URX%USS4[R"SSXU55 URX$USS4[R"SSXS55 URX%USS4[R"SSXS55 UR[R"SSUSS55 [R(a�UR[R"SSX4U55 URX4USS4[R"SSX4U55 URX4USS4[R"SSXU55 UR[R"SSX$U55 UR[R"S	SX4U55 gg)
N���1.2.3.4�r?r@s1.2.3.4r)�::3r@rrrAz::3%lo0)r)r rrr#r$r!r"�assertEqualr�_ipaddr_info�assertIsNoner
�IPV6_ENABLED)�self�UNSPEC�INET�INET6�STREAM�DGRAM�TCP�UDPs        r�test_ipaddr_info�BaseEventTests.test_ipaddr_info;sw���!�!���~�~�������#�#���!�!��� � ��� � �����
�3��N�3��$�$�Y��4��E�	G�	
���
�3��N�3��$�$�Z��D�#�F�	H�	
���
�3��N�3��$�$�Y��6�3�G�	I�	
���
�#�r�>�2��$�$�Y��6�#�F�	H�
	
���
�3��N�3��$�$�Y��6�1�E�	G�
	
���
�#�r�>�2��$�$�Y��6�!�D�	F�
	
����$�$�Y��6�1�a�@�	B��%�%�����(�(��A�u�c�J�
L�
�����R�)9�:��(�(���5�#�F�
H�
�����R�)9�:��(�(���6�3�G�
I�

����(�(���4��E�
G�
����(�(��A�u�c�J�
L�%&rc
�&�[Rn[Rn[RnUR	XUSS4[
R"SSXU55 UR	XUSS4[
R"SSXU55 UR	XUSS4[
R"SSXU55 UR	XUSS4[
R"SSXU55 UR	XUSS4[
R"SSXU55 g)Nr=�r?rr?rr>�1�1)r)rr#r!rBrrC)rFrHrJrLs    r�test_port_parameter_types�(BaseEventTests.test_port_parameter_typesws���~�~���#�#��� � �����
�3��N�3��$�$�Y��d�C�H�	J�	
���
�3��N�3��$�$�Y��T�3�G�	I�	
���
�3��N�3��$�$�Y��D�#�F�	H�	
���
�3��N�3��$�$�Y��T�3�G�	I�	
���
�3��N�3��$�$�Y��d�C�H�	Jrc	��U?UR[R"SS[R
[R[R55 g)Nr?r@)r'rDrrCr)rr#r!�rFr1s  r�test_ipaddr_info_no_inet_pton�,BaseEventTests.test_ipaddr_info_no_inet_pton�sB�������+�2�2�9�a�39�>�>�39�3E�3E�39�3E�3E�G�	HrrN)	rrrrrNrTr8rXrrrrr:r:9s%��:L�xJ�4�H��Hrr:c�6^�\rSrSrU4SjrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"S!r#S"r$S#r%S$r&S%r'S&r(S'r)S(r*S)r+S*r,S+r-S,r.S-r/S.r0S/r1S0r2U=r3$)1�BaseEventLoopTests�c�>�[TU]5 [R"5Ul[
R"5URlSURRRl	URUR5 g�Nr)�super�setUpr�
BaseEventLoop�loopr�Mock�	_selector�selectr0�set_event_loop�rF�	__class__s �rr`�BaseEventLoopTests.setUp�sX���
��
���-�-�/��	�"�i�i�k��	�	��24��	�	���"�"�/����D�I�I�&rc	�D�[R"5nUR[URR
X5 UR[URRXX5 UR[URRX5 UR[URR/5 UR[URR5 UR[URRX5 UR[URRX5 URRXXXU5nUR[5 URS5 SSS5 g!,(df   g=fr)rrc�assertRaises�NotImplementedErrorrb�_make_socket_transport�_make_ssl_transport�_make_datagram_transport�_process_events�_write_to_self�_make_read_pipe_transport�_make_write_pipe_transport�_make_subprocess_transport�send)rF�m�gens   r�test_not_implemented�'BaseEventLoopTests.test_not_implemented�s6���I�I�K�������I�I�,�,�a�	4�	
�����I�I�)�)�1��	7�	
�����I�I�.�.��	6�	
�������!:�!:�B�	@��������!9�!9�	;������I�I�/�/��	7�	
�����I�I�0�0�!�	8��i�i�2�2�1��q�Q�G��
�
�
�2�
3��H�H�T�N�4�
3�
3�s�6F�
Fc�"�URURR55 URR5 UR	URR55 URR5 URR5 URR5nUR
[URR5 UR
[URRU5 gr)
�assertFalserb�	is_closed�close�
assertTrue�
create_futurerk�RuntimeError�run_forever�run_until_complete)rFr7s  r�
test_close�BaseEventLoopTests.test_close�s���������,�,�.�/��	�	��������	�	�+�+�-�.�	
�	�	�����	�	����
�I�I�#�#�%�����,��	�	�(=�(=�>����,��	�	�(D�(D�a�Hrc��[R"SSURS5nURRU5 UR	URR
5 UR
XRR5 g)Nc��g�NFrrrr�<lambda>�>BaseEventLoopTests.test__add_callback_handle.<locals>.<lambda>����5rr)r�Handlerb�
_add_callbackr{�
_scheduled�assertIn�_ready�rF�hs  r�test__add_callback_handle�,BaseEventLoopTests.test__add_callback_handle�sZ���N�N�=�"�d�i�i��>���	�	����"�������-�-�.��
�
�a���)�)�*rc�6�[R"SSURS5nUR5 URR	U5 URURR5 URURR5 g)Nc��gr�rrrrr��HBaseEventLoopTests.test__add_callback_cancelled_handle.<locals>.<lambda>�r�rr)rr�rb�cancelr�r{r�r�r�s  r�#test__add_callback_cancelled_handle�6BaseEventLoopTests.test__add_callback_cancelled_handle�se���N�N�=�"�d�i�i��>��	���
��	�	����"�������-�-�.�������)�)�*rc�h�"SS[RR5n[R"5UR
l[R"5UR
lU"5nUR
RU5 URX R
R5 g)Nc��\rSrSrSrSrg)�CBaseEventLoopTests.test_set_default_executor.<locals>.DummyExecutor��c��[S5e)Nz#cannot submit into a dummy executor)rl)rF�fn�args�kwargss    r�submit�JBaseEventLoopTests.test_set_default_executor.<locals>.DummyExecutor.submit�s��)�9�;�;rrN)rrrrr�rrrr�
DummyExecutorr��s��
;rr�)�
concurrent�futures�ThreadPoolExecutorrrcrbrprq�set_default_executor�assertIs�_default_executor)rFr��executors   r�test_set_default_executor�,BaseEventLoopTests.test_set_default_executor�so��	;�J�.�.�A�A�	;�
%)�I�I�K��	�	�!�#'�9�9�;��	�	� � �?���	�	�&�&�x�0��
�
�h�	�	� ;� ;�<rc��[R"5nSnUR[U5 URRU5 SSS5 UR
URR5 g!,(df   N4=f)Nz,executor must be ThreadPoolExecutor instance)rrc�assertRaisesRegex�	TypeErrorrbr�rDr�)rFr��msgs   r�test_set_default_executor_error�2BaseEventLoopTests.test_set_default_executor_error�s\���9�9�;��<��
�
#�
#�I�s�
3��I�I�*�*�8�4�4�	
���$�)�)�5�5�6�4�
3�s�A8�8
Bc�`^�[R"5m"U4SjS[RR5n[
R"5URl[
R"5URl	U"5nURRU5 UR[S5 URRURRSS95 SSS5 TR5 g!,(df   N=f!TR5 f=f)Nc�.>�\rSrSrSSS.U4SjjjrSrg)�PBaseEventLoopTests.test_shutdown_default_executor_timeout.<locals>.DummyExecutor��F)�cancel_futuresc�6>�U(aTR5 ggr)�wait)rFr�r��events   �r�shutdown�YBaseEventLoopTests.test_shutdown_default_executor_timeout.<locals>.DummyExecutor.shutdown�s�����J�J�L�rrN)T)rrrrr�r)r�s�rr�r��s���
!�E�
!�
!rr�z&The executor did not finishing joining�{�G�z�?)�timeout)�	threading�Eventr�r�r�rrcrbrprqr��assertWarnsRegex�RuntimeWarningr��shutdown_default_executor�set)rFr�r�r�s   @r�&test_shutdown_default_executor_timeout�9BaseEventLoopTests.test_shutdown_default_executor_timeout�s�������!��	!�J�.�.�A�A�	!�
%)�I�I�K��	�	�!�#'�9�9�;��	�	� � �?���	�	�&�&�x�0�	��&�&�~�'O�Q��	�	�,�,��I�I�7�7��7�E�G�Q�

�I�I�K�Q�Q��

�I�I�K�s$�(D�>3D
�1D�

D�D�D-c��SnURRU5nURURU5 UR	U[
R5 URX RR5 g)Nc��grrrrr�cb�-BaseEventLoopTests.test_call_soon.<locals>.cb���r)	rb�	call_soonrB�	_callback�assertIsInstancerr�r�r��rFr�r�s   r�test_call_soon�!BaseEventLoopTests.test_call_soons[��	�
�I�I����#��������b�)����a����0��
�
�a���)�)�*rc���URRS5 UR[S5 URR	S5 SSS5 g!,(df   g=f)NTza callable objectr@)rb�	set_debugr�r�r��rFs r�test_call_soon_non_callable�.BaseEventLoopTests.test_call_soon_non_callable
sD���	�	���D�!�
�
#�
#�I�/B�
C��I�I����"�D�
C�
C�s�A�
A%c��SnURRSU5nURU[R5 URX RR5 URX RR5 UR[SS9 URRSU5 SSS5 g!,(df   g=f)Nc��grrrrrr��.BaseEventLoopTests.test_call_later.<locals>.cbr�r�$@zdelay must not be None�r�)rb�
call_laterr�r�TimerHandler�r��assertNotInr�rkr�r�s   r�test_call_later�"BaseEventLoopTests.test_call_laters���	�
�I�I� � ��r�*�����a��!4�!4�5��
�
�a���-�-�.�����I�I�,�,�-�
�
�
�y�.F�
�
G��I�I� � ��r�*�H�
G�
G�s�C�
Cc�:^�/mU4Sjn[R"5URlURR	SUS5 URR	SUS5 [
R"UR5 URTSS/5 g)Nc�(>�TRU5 gr)�append)�arg�callss �rr��>BaseEventLoopTests.test_call_later_negative_delays.<locals>.cb s����L�L��r����a����b)rrcrbrpr�r.�run_brieflyrB)rFr�r�s  @r�test_call_later_negative_delays�2BaseEventLoopTests.test_call_later_negative_delaysss�����	�%)�I�I�K��	�	�!��	�	���R��S�)��	�	���R��S�)����t�y�y�)������c�
�+rc�H^�U4Sjn[R"5TRlSnTRR	5U-nTRRX15 TRR	5nTRR
5 TRR	5U-
nTRXR[R-
5 TR[SS9 TRRSU5 SSS5 g!,(df   g=f)Nc�:>�TRR5 gr�rb�stopr�s�rr��4BaseEventLoopTests.test_time_and_call_at.<locals>.cb*s����I�I�N�N�r皙�����?zwhen cannot be Noner�)rrcrbrp�time�call_atr��assertGreaterEqualr.�	CLOCK_RESrkr�)rFr��delay�when�t0�dts`     r�test_time_and_call_at�(BaseEventLoopTests.test_time_and_call_at)s����	�%)�I�I�K��	�	�!����y�y�~�~��%�'���	�	���$�#�
�Y�Y�^�^�
���	�	����
�Y�Y�^�^�
��
"��	
����J�,@�,@�$@�A�
�
�
�y�.C�
�
D��I�I���d�B�'�E�
D�
D�s�-D�
D!c�x�SnURU5 U(a�SnUR[U5 URU5 SSS5 UR[U5 UR	SU5 SSS5 UR[U5 URUR
5S-U5 SSS5 gURU5 UR	SU5 URUR
5S-U5 g!,(df   N�=f!,(df   N�=f!,(df   g=f)Nc��grrrrrr��+BaseEventLoopTests.check_thread.<locals>.cb<r�rzMNon-thread-safe operation invoked on an event loop other than the current one�<)r�r�r�r�r�r�r�)rFrb�debugr�r�s     r�check_thread�BaseEventLoopTests.check_thread;s���	�	
���u���*�C��'�'��c�:����r�"�;��'�'��c�:�����B�'�;��'�'��c�:����T�Y�Y�[�2�-�r�2�;�:�
�N�N�2���O�O�B��#��L�L�����r�)�2�.�;�:��:�:��:�:�s#�D	�$D�$D+�	
D�
D(�+
D9c�H^^�U4SjmSU4Sjjn[R"5TRl[R"5TRlU"TRS5 U"TRS5 U"TRSSS9 U"TRSSS9 g)Nc�>�UR5 U(ad[R"5n[R"U5 TRX5 [R"S5 UR
5 OTRX5 URURS5 g![R"S5 UR
5 f=f![a&nURURU5 SnAgSnAff=fr)r�rrarrfrr}�call_soon_threadsafe�
set_result�	Exception�
set_exception)rbr�r�create_loop�fut�loop2�excrFs       �r�check_in_thread�=BaseEventLoopTests.test_check_thread.<locals>.check_in_threadOs�����J�J�L�
@��'�5�5�7�E�&��.�.�u�5��)�)�$�6��.�.�t�4����
��%�%�d�2��)�)�#�.�.�$�?�� �.�.�t�4����
���
B��)�)�#�*;�*;�S�A�A��
B�s.�C�'B,�8C�,(C�C�
D�!D�DFc�>�[R"5nUR5nURUR5 XXU4n[R
"TUS9nUR
5 URU5 UR5 g)N)�targetr�)	r�r�rr�r��Thread�startr��join)rbrrr�r
r��threadrs       �r�test_thread�9BaseEventLoopTests.test_check_thread.<locals>.test_threadcsk����O�O�%�E��$�$�&�C��N�N�5�9�9�%���S�9�D��%�%�_�4�H�F��L�L�N��#�#�C�(��K�K�MrT)r�F)rrcrbrprq)rFrrs` @r�test_check_thread�$BaseEventLoopTests.test_check_threadNsx���	@�(	�%)�I�I�K��	�	�!�#'�9�9�;��	�	� �	�D�I�I�t�$�	�D�I�I�u�%�	�D�I�I�t��6�	�D�I�I�u�$�7rc�v�[R"[R"5S-SSURS5n[R"[R"5S-SSURS5nUR5 [R"5URlURRRU5 URRRU5 URR5 URRRRSSnURSUs=:=(a S:Os U5 UR!U/URR5 URURRR"5 g)	Ng@c��g�NTrrrrr��3BaseEventLoopTests.test__run_once.<locals>.<lambda>~s��rrr�c��grrrrrr�r �s��$rrg#@g%@)rr�r��	monotonicrbr�rrcrpr�r��	_run_oncerdre�	call_argsr~rB�called)rF�h1�h2�ts    r�test__run_once�!BaseEventLoopTests.test__run_once}s*��
�
 �
 ����!1�C�!7��r�!%���D�2��
�
 �
 ����!1�D�!8�,��!%���D�2��	�	�	��$(�I�I�K��	�	�!��	�	���#�#�B�'��	�	���#�#�B�'��	�	�����I�I���&�&�0�0��3�A�6������a���$���*����"��t�y�y�3�3�4�����	�	�1�1�8�8�9rc��URRS5 URURR55 URRS5 UR	URR55 g)NTF)rbr�r~�	get_debugr{r�s r�test_set_debug�!BaseEventLoopTests.test_set_debug�sZ���	�	���D�!�����	�	�+�+�-�.��	�	���E�"�������,�,�.�/rc��^^�SmSmUU4Sjn[R"[R"5S-
XR4URS5n[
R"5URlURRRU5 URR5 URT5 URT/[URR55 g)NFc�.>�SmURS5mg)NTc��grrrrrr��OBaseEventLoopTests.test__run_once_schedule_handle.<locals>.cb.<locals>.<lambda>�s��Dr)r�)rb�handle�	processeds ��rr��=BaseEventLoopTests.test__run_once_schedule_handle.<locals>.cb�s����I��^�^�L�1�Frr@)rr�r�r"rbrrcrpr�r�r#r~rB�listr�)rFr�r�r3r4s   @@r�test__run_once_schedule_handle�1BaseEventLoopTests.test__run_once_schedule_handle�s�������	�	2�

������ 0�1� 4�b�9�9�,� $�	�	�4�
1��%)�I�I�K��	�	�!��	�	���#�#�A�&��	�	�������	�"����&��4��	�	�(8�(8�#9�:rc��[R"5URlUR	S[
Rs=:=(a S:Os 5 SnSnURRSU5 Sn[S5H/nURRSU5nUR5 M1 US-
n[S5H/nURRSU5nUR5 M1 URX2-[
R5 URURRU5 URR5 US-nURURRU5 UR[URR 5X2-5 [#[$R&"[
R[
R-55S-n[)[
RU-
S5nX'-
n[U5HnURRSU5 M! X6-
n[U5H/nURRSU5nUR5 M1 UR[URR 5X2-5 URR5 UR[URR 5U5 UR	[+URR Vs/sHoDR,(+PM sn55 gs snf)	Nrg�?c��grrrrrr��EBaseEventLoopTests.test__run_once_cancelled_event_cleanup.<locals>.cb�r�rr@��i�d)rrcrbrpr~r�%_MIN_CANCELLED_TIMER_HANDLES_FRACTIONr��ranger��assertLessEqual�_MIN_SCHEDULED_TIMER_HANDLESrB�_timer_cancelled_countr#�lenr��int�math�ceil�max�all�
_cancelled)rFr��not_cancelled_count�cancelled_count�xr��add_cancel_count�add_not_cancel_counts        r�&test__run_once_cancelled_event_cleanup�9BaseEventLoopTests.test__run_once_cancelled_event_cleanup�s���$(�I�I�K��	�	�!����
��A�A�G�G�C�G�	I�	� ���	�	���T�2�&�
���q��A��	�	�$�$�T�2�.�A�
�H�H�J��
	�1����q��A��	�	�$�$�S�"�-�A�
�H�H�J��
	
���_�B��4�4�	6�	
������9�9�?�K��	�	�����1���������9�9�?�K�����T�Y�Y�1�1�2��1�	3�
�t�y�y��4�4��=�=�
>� ?�@�BC�D�� #�;�#K�#K��$�� !��	�3���+�,�A��I�I� � ��r�*�-�	�+���'�(�A��	�	�$�$�T�2�.�A�
�H�H�J�)�
	
����T�Y�Y�1�1�2��1�	3�	
�	�	����	
����T�Y�Y�1�1�2�4G�H�	
����t�y�y�7K�7K�L�7K�!���-�7K�L�M�N��Ls�-Mc�Z�UR[URRS5 g)N�blah)rkr�rbr�r�s r�"test_run_until_complete_type_error�5BaseEventLoopTests.test_run_until_complete_type_error�s!�����)��I�I�(�(�&�	2rc���URR5nUR5nURUR5 UR[URU5 gr)rbr�
new_test_loop�
addCleanupr}rk�
ValueErrorr�)rF�task�
other_loops   r�test_run_until_complete_loop�/BaseEventLoopTests.test_run_until_complete_loop�sO���y�y�&�&�(���'�'�)�
����
�(�(�)����*��)�)�4�	1rc�^�"SS[5mSnU4Sjn[R"5URlURRU5 UR
T5 URRU"S55 SSS5 URRU"S55 g!,(df   N0=f)Nc��\rSrSrSrg)�]BaseEventLoopTests.test_run_until_complete_loop_orphan_future_close_loop.<locals>.ShowStopperirNrrrr�ShowStopperr`���rrac��L# �[R"U5IShv�N gN7fr�r�sleep)r�s r�foo�UBaseEventLoopTests.test_run_until_complete_loop_orphan_future_close_loop.<locals>.foos����-�-��&�&�&�s�$�"�$c�>�Terr)ras�r�throw�WBaseEventLoopTests.test_run_until_complete_loop_orphan_future_close_loop.<locals>.throws	����rr�g�������?)�
SystemExitrrcrbrpr�rkr�)rFrfriras   @r�5test_run_until_complete_loop_orphan_future_close_loop�HBaseEventLoopTests.test_run_until_complete_loop_orphan_future_close_loop�s����	�*�	�	'�	�%)�I�I�K��	�	�!��	�	���E�"�
�
�
�{�
+��I�I�(�(��S��2�,�
	
�	�	�$�$�S��X�.�,�
+�s�*"B6�6
Cc��[RSS/nUR[URR
URR[R5 UR[URR
URR[RU5 UR[URR
URR[R[RS5 UR"[URR
URR[R/UQ7SS06 UR"[URR
URR[R/UQ7SS06 UR"[URR
URR[R/UQ7SS06 g)	N�-c�pass�{�universal_newlinesT�shell�bufsize�)	�sys�
executablerkr�rbr��subprocess_execr�SubprocessProtocol)rFr�s  r�!test_subprocess_exec_invalid_args�4BaseEventLoopTests.test_subprocess_exec_invalid_argss�������f�-��	
���)��I�I�(�(�$�)�)�*C�*C��&�&�	(�
	
���)��I�I�(�(�$�)�)�*C�*C��&�&��	.�
	
���)��I�I�(�(�$�)�)�*C�*C��&�&�����	=�
	
���)��	�	�$�$�d�i�i�&?�&?��&�&�	H�)-�	H�BF�	H�	
���)��I�I�(�(�$�)�)�*C�*C��&�&�	;�)-�	;�59�	;�	
���)��I�I�(�(�$�)�)�*C�*C��&�&�	=�)-�	=�7;�	=rc	�6�UR[URRURR[
RS5 UR[URRURR[
R[RSS/5 UR[URRURR[
RSSS9 UR[URRURR[
RSSS9 UR[URRURR[
RSSS	9 g)
Nrqrorpzexit 0T)rr)rsru)rt)	rkr�rbr��subprocess_shellrryrvrwr�s r�"test_subprocess_shell_invalid_args�5BaseEventLoopTests.test_subprocess_shell_invalid_args/s1�����)��I�I�(�(�$�)�)�*D�*D��&�&��	-�	
���)��I�I�(�(�$�)�)�*D�*D��&�&�����v�(F�	H�
	
���)��I�I�(�(�$�)�)�*D�*D��&�&��T�	�	K�	
���)��I�I�(�(�$�)�)�*D�*D��&�&���	�	>�	
���)��I�I�(�(�$�)�)�*D�*D��&�&��$�	�	@rc�^�[R"5TRlSn[R"S5nTRR5nTRR
X5 URU4Sj5 TRR5 URR[R"S5[[[4S9 SSS5 [R"S5nTRR5nTRRSX5 URU4Sj5 TRR5 URR[R"S5[[[4S9 SSS5 g!,(df   N�=f!,(df   g=f)Nc�0�URS5 SS- g)NTr@r)r	�r
s r�
zero_error�HBaseEventLoopTests.test_default_exc_handler_callback.<locals>.zero_errorFs���N�N�4� �
�a�Cr�asyncio.base_events.loggerc�8>�TRR5$rr��r
rFs �rr��FBaseEventLoopTests.test_default_exc_handler_callback.<locals>.<lambda>N����d�i�i�n�n�.>r�Exception in callback.*zero��exc_infor�c�8>�TRR5$rr�r�s �rr�r�Xr�r)rrcrbrpr6rr��add_done_callbackr��error�assert_called_withr.�MockPattern�ZeroDivisionError�MOCK_ANYr�)rFr��logr
s`   r�!test_default_exc_handler_callback�4BaseEventLoopTests.test_default_exc_handler_callbackCsE���$(�I�I�K��	�	�!�	�
�Z�Z�4�
5���)�)�)�)�+�C��I�I���
�0��!�!�">�?��I�I�!�!�#��I�I�(�(��&�&�'D�E�+�X�x�@�
)�
B�6��Z�Z�4�
5���)�)�)�)�+�C��I�I� � ��z�7��!�!�">�?��I�I�!�!�#��I�I�(�(��&�&�'D�E�+�X�x�@�
)�
B�6�
5�6�
5��6�
5�s�B"F+�?B#F<�+
F9�<
G
c�^�[R"5TRlSn[R"S5n[
R"U"5TRS9nURU4Sj5 TRR5 Sn[R"5 URR[R"S5[[ [ 4S9 SSS5 g!,(df   g=f)Nc��V# �[R"S5IShv�N SS- gN
7f)Nr�r@rrdrrr�zero_error_coro�IBaseEventLoopTests.test_default_exc_handler_coro.<locals>.zero_error_coroas#����-�-��%�%�%�
�a�C�
&�s�)�'�)r��rbc�8>�TRR5$rr�)r�rFs �rr��BBaseEventLoopTests.test_default_exc_handler_coro.<locals>.<lambda>hs����	�	���0@rz.*exception was never retrievedr�)rrcrbrpr6r�
ensure_futurer�r�r�
gc_collectr�r�r.r�r�r�)rFr�r�r
s`   r�test_default_exc_handler_coro�0BaseEventLoopTests.test_default_exc_handler_coro^s����$(�I�I�K��	�	�!�	�
�Z�Z�4�
5���'�'��(9��	�	�J�C��!�!�"@�A��I�I�!�!�#��C���� ��I�I�(�(��&�&�'H�I�+�X�x�@�
)�
B�6�
5�
5�s�B(C0�0
C>c��UR[S5 URRS5 SSS5 g!,(df   g=f)NzA callable object or None�spam)r�r�rb�set_exception_handlerr�s r�test_set_exc_handler_invalid�/BaseEventLoopTests.test_set_exc_handler_invalidqs2��
�
#�
#�I�/J�
K��I�I�+�+�F�3�L�
K�
K�s	�<�
A
c�^^�SmUU4SjnTRRS5 [R"5TRlTRTRR
55 [R"5nTRRU5 TRTRR
5U5 U"5nURTR[[R"S5UURS.5 UR5 TRRS5 [R"S5nU"5 UR R[R"S5["[[4S9 SSS5 TR%UR&5 g!,(df   N*=f)	Nc��SS- g�Nr@rrrrrr��BBaseEventLoopTests.test_set_exc_handler_custom.<locals>.zero_errorvs	��
�a�Crc�r>�TRRT5nTRR5 U$r�rbr�r#)r3rFr�s ��r�run_loop�@BaseEventLoopTests.test_set_exc_handler_custom.<locals>.run_loopys,����Y�Y�(�(��4�F��I�I���!��MrTz!Exception in callback.*zero_error)�	exception�messager3�source_tracebackr�r�r�)rbr�rrcrprD�get_exception_handlerr�r�r�r�r.r��_source_traceback�
reset_mockr6r�r�r{r%)rFr��mock_handlerr3r�r�s`    @r�test_set_exc_handler_custom�.BaseEventLoopTests.test_set_exc_handler_customusR���	�	�
	
�	�	���D�!�$(�I�I�K��	�	�!����$�)�)�9�9�;�<��y�y�{���	�	�'�'��5��
�
�d�i�i�5�5�7��F�����'�'��	�	�!�!�-�-� C�E�� &� 8� 8�4
�	�	���!��	�	�'�'��-�
�Z�Z�4�
5���J��I�I�(�(�"�.�.� =�?�"3�X�x�!H�
)�
J�6�	
����,�,�-�6�
5�s
�AG�
Gc�~^�U4SjnSn[R"5TRlTRR	U5 [R
"S5nU"5 URR[R"S5[[[4S9 SSS5 g!,(df   g=f)Nc�v>�SnTRRU5 TRR5 g)Nc��SS- gr�rrrrr��TBaseEventLoopTests.test_set_exc_handler_broken.<locals>.run_loop.<locals>.zero_error��	���!�rr�)r�rFs �rr��@BaseEventLoopTests.test_set_exc_handler_broken.<locals>.run_loop�s*���
��I�I���
�+��I�I���!rc��[S5e�Nr�)�AttributeError�rb�contexts  r�handler�?BaseEventLoopTests.test_set_exc_handler_broken.<locals>.handler�s
�� ��(�(rr�z$Unhandled error in exception handlerr�)rrcrbrpr�r6r�r�r.r�r�r�)rFr�r�r�s`   r�test_set_exc_handler_broken�.BaseEventLoopTests.test_set_exc_handler_broken�s����	"�	)�%)�I�I�K��	�	�!��	�	�'�'��0�
�Z�Z�4�
5���J��I�I�(�(��&�&�:�<�(�(�H�=�
)�
?�6�
5�
5�s
� AB.�.
B<c��^^�Sm"U4SjS[R5nU"5mURTR5 [R
"T5 U4Sjn[R"S5nU"5 URRSSS9 SSS5 SnSmTRU5 [R"S5nU"5 URR[R"S	5SS9 URS
T5 UR[TS
S5[ 5 SSS5 g!,(df   N�=f!,(df   g=f)Nc�f>�\rSrSr\R
"5r\R
"5rU4SjrSr	g)�@BaseEventLoopTests.test_default_exc_handler_broken.<locals>.Loopi�c�>�Um[S5er��rY)rFr��_contexts  �r�default_exception_handler�ZBaseEventLoopTests.test_default_exc_handler_broken.<locals>.Loop.default_exception_handler�s���"�� ��(�(rrN)
rrrrrrcrdrpr�r)r�s�r�Loopr��s#����	�	��I�"�i�i�k�O�
)�
)rr�c�N>�SnTRU5 TR5 g)Nc��SS- gr�rrrrr��XBaseEventLoopTests.test_default_exc_handler_broken.<locals>.run_loop.<locals>.zero_error�r�r)r�r#)r�rbs �rr��DBaseEventLoopTests.test_default_exc_handler_broken.<locals>.run_loop�s���
��N�N�:�&��N�N�rr�z&Exception in default exception handlerTr�c��[S5e)N�hamr�r�s  r�custom_handler�JBaseEventLoopTests.test_default_exc_handler_broken.<locals>.custom_handler�s
���U�#�#rz9Exception in default exception.*while handling.*in customr�r�)rrarXr}rrfrr6r�r�r�r.r�r�r��typer�)rFr�r�r�r�r�rbs     @@r�test_default_exc_handler_broken�2BaseEventLoopTests.test_default_exc_handler_broken�s%�����		)�;�,�,�		)��v������
�
�#����t�$�	��Z�Z�4�
5���J��I�I�(�(�8��
)�
�6�	$����"�"�>�2�
�Z�Z�4�
5���J��I�I�(�(��&�&�(C�D��
)�
�
�M�M�)�X�.��M�M�$�x�	�2�;�?�@�+�
-�6�
5�6�
5��6�
5�s�5"E�A-E�
E�
E c���UR[S5 URRS5 SSS5 UR	URR55 g!,(df   N8=f)Nz'task factory must be a callable or Noner@)r�r�rb�set_task_factoryrD�get_task_factoryr�s r�test_set_task_factory_invalid�0BaseEventLoopTests.test_set_task_factory_invalid�s[��
�
#�
#��@�B�
�I�I�&�&�q�)�B�
	
���$�)�)�4�4�6�7�B�B�s�A%�%
A3c�^�[R"5URl"SS[R
5mSnU4SjnUR
URR55 URRU5 URURR5U5 URRU"55nUR[UT55 URRU5 URRS5 UR
URR55 URRU"55nUR[U[R
55 UR[UT55 URRU5 g)Nc��\rSrSrSrg)�8BaseEventLoopTests.test_set_task_factory.<locals>.MyTaski�rNrrrr�MyTaskr��rbrr�c��# �g7frrrrr�coro�6BaseEventLoopTests.test_set_task_factory.<locals>.coro��������c�>�T"XS9$�Nr�r)rbr�r�s  �rr��:BaseEventLoopTests.test_set_task_factory.<locals>.<lambda>�s
���V�D�%<r)rrcrbrpr�TaskrDr�r�r��create_taskr~�
isinstancer�r{)rFr��factoryrZr�s    @r�test_set_task_factory�(BaseEventLoopTests.test_set_task_factory�s5���$(�I�I�K��	�	�!�	�W�\�\�	�	�=�����$�)�)�4�4�6�7��	�	�"�"�7�+��
�
�d�i�i�0�0�2�G�<��y�y�$�$�T�V�,�����
�4��0�1��	�	�$�$�T�*��	�	�"�"�4�(����$�)�)�4�4�6�7��y�y�$�$�T�V�,�����
�4����6�7�����D�&�1�2��	�	�$�$�T�*rc��SRS5n[SSU5up#nURUR5S5 [SUSSS9up#nURUR5S5 [SUSSS9up#nURUR5S	5 [SSUSS
9up#nURUR5S5 [SSSSU5up#nURUR5S	5 g)
N�
)zimport asynciozloop = asyncio.new_event_loop()zprint(loop.get_debug())z-ErosFalser=)�PYTHONASYNCIODEBUG�
PYTHONDEVMODErRsTrue)r�z-X�dev)rrrB�rstrip)rF�code�sts�stdout�stderrs     r�test_env_var_debug�%BaseEventLoopTests.test_env_var_debugs���y�y�'�(��/�t�T�4�@���V��������(�3�.�t�T�BD�=?�A���V�	
�������(�3�.�t�T�BE�=?�A���V�	
�������'�2�.�t�T�4�BE�G���V��������(�3�/�t�T�5�/3�T�;���V��������'�2rc�4^^�"SS[R5mSn"UU4SjS[R5nU"5mUR	T5 U"5n[R
"UTS9nUR
UT5 SUlUR5 g)Nc��\rSrSrSrg)�3BaseEventLoopTests.test_create_task.<locals>.MyTaski rNrrrrr�r rbrr�c��# �g7frrrrr�test�1BaseEventLoopTests.test_create_task.<locals>.test#r�r�c�$>�\rSrSrUU4SjrSrg)�6BaseEventLoopTests.test_create_task.<locals>.EventLoopi&c�>�T"UTS9$r�r)rFr�r�rbs  ��rr��BBaseEventLoopTests.test_create_task.<locals>.EventLoop.create_task's����d��.�.rrN)rrrrr�r)r�rbs��r�	EventLoopr&s
���
/�
/rrr�F)	rr�rrarfr�r��_log_destroy_pendingr})rFrrr�rZr�rbs     @@r�test_create_task�#BaseEventLoopTests.test_create_tasks����	�W�\�\�	�	�	/�	/��1�1�	/��{�����D�!��v���$�$�T��5�����d�F�+�%*��!��
�
�rc�x�Sn[R"5nUR5 [R"SS9nUR[5 [R"U"5US9 SSS5 UR[U5S5 SSS5 g!,(df   N2=f!,(df   g=f)Nc��# �g7frrrrrr�CBaseEventLoopTests.test_create_task_error_closes_coro.<locals>.test6r�r�T)�recordr�r)
r�new_event_loopr}�warnings�catch_warningsrkr�r�rBrD)rFrrb�ws    r�"test_create_task_error_closes_coro�5BaseEventLoopTests.test_create_task_error_closes_coro5s��	��%�%�'���
�
��
�
$�
$�D�
1�Q��"�"�<�0��%�%�d�f�4�8�1����S��V�Q�'�2�
1�0�0��2�
1�s#�B+�B�.#B+�
B(	�$B+�+
B9c�.�Sn[R"5nURU"5SS9nURUR	5S5 URU5 UR
5 g!URU5 UR
5 f=f)Nc��# �g7frrrrrr�LBaseEventLoopTests.test_create_named_task_with_default_factory.<locals>.testAr�r��	test_task�r2)rrr�rB�get_namer�r})rFrrbrZs    r�+test_create_named_task_with_default_factory�>BaseEventLoopTests.test_create_named_task_with_default_factory@s{��	��%�%�'�������[��9��	����T�]�]�_�k�:��#�#�D�)��J�J�L��
�#�#�D�)��J�J�L�s� A1�1#Bc�V�SnSn[R"5nURU5 URU"5SS9nUR	UR5S5 UR
U5 UR5 g!UR
U5 UR5 f=f)Nc�4�[R"U4SU0UD6$)Nrb)rr�)rbr�r�s   r�task_factory�SBaseEventLoopTests.test_create_named_task_with_custom_factory.<locals>.task_factoryMs���<�<��:�4�:�6�:�:rc��# �g7frrrrrr�KBaseEventLoopTests.test_create_named_task_with_custom_factory.<locals>.testPr�r�rr)rrr�r�rBrr�r})rFr rrbrZs     r�*test_create_named_task_with_custom_factory�=BaseEventLoopTests.test_create_named_task_with_custom_factoryLs���	;�	��%�%�'�����l�+������[��9��	����T�]�]�_�k�:��#�#�D�)��J�J�L��
�#�#�D�)��J�J�L�s� B�#B(c��Sn[R"5URl[R"5URlURRU"55 URR5 [R"5 URURRR5 g![a Nkf=f)Nc��# �[e7fr��KeyboardInterruptrrr�raise_keyboard_interrupt�XBaseEventLoopTests.test_run_forever_keyboard_interrupt.<locals>.raise_keyboard_interrupt`����#�#���	)rrcrbrp�call_exception_handlerr�r)r}rr�r{r%)rFr*s  r�#test_run_forever_keyboard_interrupt�6BaseEventLoopTests.test_run_forever_keyboard_interrupt\s���	$�%)�I�I�K��	�	�!�+/�9�9�;��	�	�(�	��I�I�(�(�)A�)C�D�	
�	�	��������������9�9�@�@�A��!�	��	�s�
 C�
C�Cc��^^�Sn[R"5TRlTR	[
5 TRR
U"55 SSS5 UU4SjmSTlTRRTRRT5 TRR5 TRTR5 g!,(df   N�=f)Nc��# �[e7frr(rrrr*�ZBaseEventLoopTests.test_run_until_complete_baseexception.<locals>.raise_keyboard_interruptrr,r-c�H>�TRR5 STlgr)rbr�r%)�funcrFs��rr5�FBaseEventLoopTests.test_run_until_complete_baseexception.<locals>.funczs����I�I�N�N���D�KrF)rrcrbrprkr)r�r%r�r�r~)rFr*r5s` @r�%test_run_until_complete_baseexception�8BaseEventLoopTests.test_run_until_complete_baseexceptionos����	$�%)�I�I�K��	�	�!�
�
�
�0�
1��I�I�(�(�)A�)C�D�2�	�����	�	���D�I�I�/�/��6��	�	����������$�2�
1�s�!C�
C*c�^^^^^^�[5mSmSmUUUU4SjnUUU4SjmUU4SjmUTRlT4TRRRl[
SS5H{nTRSU-5 TRRTRR5 TRR5 TRTS5 SSS5 M} g!,(df   M�=f)Nrc�J>�TU;aTRRT5mggr�rbr�)�
event_list�do_event�doer�event_sentinelrFs ����r�proc_events�ZBaseEventLoopTests.test_single_selecter_event_callback_after_stopping.<locals>.proc_events�s$�����+��y�y�*�*�8�4��,rc�F>�TS-
mTRRT5 g�Nr@r;)�	callcount�clear_selectorrFs���rr=�WBaseEventLoopTests.test_single_selecter_event_callback_after_stopping.<locals>.do_event�s�����N�I��I�I����/rc�p>�TR5 STRRRlgr^)r�rbrdrer0)r>rFs��rrE�]BaseEventLoopTests.test_single_selecter_event_callback_after_stopping.<locals>.clear_selector�s$����K�K�M�68�D�I�I���&�&�3rr@�z	Loop %d/2)�objectrbrprdrer0r@�subTestr�r�r�rB)rFr@�irDrEr=r>r?s`  @@@@@r�2test_single_selecter_event_callback_after_stopping�EBaseEventLoopTests.test_single_selecter_event_callback_after_stopping�s���� ����	���	5�	5�
	0�
	9�%0��	�	�!�3A�2C��	�	���"�"�/��q�!��A����k�A�o�.��	�	�#�#�D�I�I�N�N�3��	�	�%�%�'�� � ��A�.�/�.��.�.�s
�AC0�0
C?	c�^�SmU4Sjn[R"5URlURR	U5 [
R"UR5 URTS5 g)Nrc�>�TS-
mgrCr��counts�r�callback�2BaseEventLoopTests.test_run_once.<locals>.callback������Q�J�Err@)rrcrbrpr�r.�run_oncerB)rFrSrRs  @r�
test_run_once� BaseEventLoopTests.test_run_once�sW���
��	�%)�I�I�K��	�	�!��	�	���H�%����D�I�I�&������"rc��[R"5URlURR	5 URR5 URRRRS5 g�Nr)	rrcrbrpr�r�rdre�assert_called_once_withr�s r�test_run_forever_pre_stopped�/BaseEventLoopTests.test_run_forever_pre_stopped�sP��$(�I�I�K��	�	�!��	�	�����	�	�����	�	���"�"�:�:�1�=rc�b^�[R"5URlSmU4SjnURR	U5 URR5 UR
[R"5UR5 URURR55 [S5HnURR5 M URR5 UR[5 [R"5 SSS5 UR!URR55 UR
URRR"S5 UR
TS5 g!,(df   Nz=f)Nrc�>�TS-
mgrCrrQs�rrS�HBaseEventLoopTests.test_custom_run_forever_integration.<locals>.callback�rUr�
r@)rrcrbrpr��_run_forever_setuprBr�get_running_loopr~�
is_runningr@r#�_run_forever_cleanuprkr�r{�
call_count)rFrSrLrRs   @r�#test_custom_run_forever_integration�6BaseEventLoopTests.test_custom_run_forever_integration�s(���%)�I�I�K��	�	�!���	�	
�	�	���H�%�	
�	�	�$�$�&�	
����1�1�3�T�Y�Y�?�����	�	�,�,�.�/��r��A��I�I���!��	
�	�	�&�&�(��
�
�|�
,��$�$�&�-�������-�-�/�0�	
������2�2�=�=�r�B������"�-�
,�s�F � 
F.c��^^^# �SSSS.mU4SjnU"5nUR5mUUU4Sjm[R"T"55 T$7f)NF)�started�stopped�	finalizedc�T># �STS'SHnU7v� M
 STS'g!STS'f=f7f)NTrj)�ZERO�ONE�TWO�THREE�FOURrlr)�item�statuss �r�agen�;BaseEventLoopTests.leave_unfinalized_asyncgen.<locals>.agen�s;���� $�F�9��
+�C�D��J�D�'+��{�#��d��{�#�s�(��(�%�(c��># �TR5IShv�NnUS:XaSTS'g[R"T"55 gN,![a gf=f7f)NrqTrk)�	__anext__�StopAsyncIterationrr�)rs�ai�iter_onerts ���rr{�?BaseEventLoopTests.leave_unfinalized_asyncgen.<locals>.iter_one�sU����
��\�\�^�+���w��$(��y�!������
�+�
,��%�
��
�s7�A�A�A�A�(A�A�
A�A�A�A)�	__aiter__rr�)rFru�agrzr{rts   @@@r�leave_unfinalized_asyncgen�-BaseEventLoopTests.leave_unfinalized_asyncgen�sM����#�"�$�&��	+��V��
�\�\�^��	,�	���H�J�'��
�s�A	Ac��[R"5URl[R"5URl[
R"5 URRUR55nUS(d,[R"UR5 US(dM,URUS5 URUS5 URUS5 [
R"5 [R"UR5 URUS5 SSS5 g!,(df   g=f)Nrkrjrl)rrcrbrprqr�
disable_gcr�rr.r�r~r{r��rFrts  r� test_asyncgen_finalization_by_gc�3BaseEventLoopTests.test_asyncgen_finalization_by_gc�s���$(�I�I�K��	�	�!�#'�9�9�;��	�	� �
�
�
�
!��Y�Y�1�1�$�2Q�2Q�2S�T�F��Y�'��&�&�t�y�y�1��Y�'�'��O�O�F�9�-�.��O�O�F�9�-�.����V�K�0�1���� ��"�"�4�9�9�-��O�O�F�;�/�0�"�
!�
!�s�AE�>BE�
Ec�L�[R"5URl[R"5URlURRS5 [R"5 URRUR55nUS(d,[R"UR5 US(dM,URUS5 URUS5 URUS5 URRURRS[R55 [R"UR5 URUS5 SSS5 g!,(df   g=f)NTrkrjrl)rrcrbrprqr�rr�r�rr.r�r~r{�run_in_executorr�r�s  r�0test_asyncgen_finalization_by_gc_in_other_thread�CBaseEventLoopTests.test_asyncgen_finalization_by_gc_in_other_thread
s��%)�I�I�K��	�	�!�#'�9�9�;��	�	� ��	�	���D�!�
�
�
�
!��Y�Y�1�1�$�2Q�2Q�2S�T�F��Y�'��&�&�t�y�y�1��Y�'�'��O�O�F�9�-�.��O�O�F�9�-�.����V�K�0�1��I�I�(�(��	�	�)�)�$��0B�0B�C�
E��"�"�4�9�9�-��O�O�F�;�/�0�"�
!�
!�s�9AF�B3F�
F#r�)4rrrrr`rxr�r�r�r�r�r�r�r�r�r�r�rrr)r-r7rPrTr\rlrzr~r�r�r�r�r�r�r�r�r�r
rrr$r/r7rMrWr\rgrr�r�r�
__classcell__�rhs@rr[r[�s����'��2I�+�+�=�7��*+�#�
	+�
,�(�$/�&-8�^:�$0�;�&JO�X2�1�/�&=�:@�(B�6B�&4�".�H?�*.-�`8�+�63�<�,(�
�� B�&%�&/�<#� >�##�J �D
1�1�1rr[c�@�\rSrSrSrS
SjrSrSrSrSr	Sr
S	rg)�MyProtoi!Nc��SUlSUlU(a)[R"5R	5Ulgg�N�INITIALr)�state�nbytesrrcr�done)rFrs  r�__init__�MyProto.__init__$s1����
������0�0�2�@�@�B�D�I�rc�^�URU;a[SUR<SU<35eg�Nzstate: z, expected: �r��AssertionError�rF�expecteds  r�
_assert_state�MyProto._assert_state*s/���:�:�X�%� �7�4�:�:�.��X�L�!Q�R�R�&rc�b�XlURS5 SUlURS5 g)Nr��	CONNECTEDs%GET / HTTP/1.0
Host: example.com

)�	transportr�r��write�rFr�s  r�connection_made�MyProto.connection_made.s)��"�����9�%� ��
����F�Grc�b�URS5 U=R[U5-
slg)Nr��r�r�rD�rF�datas  r�
data_received�MyProto.data_received4s"�����;�'����s�4�y� �rc�4�URS5 SUlg)Nr��EOF)r�r�r�s r�eof_received�MyProto.eof_received8s�����;�'���
rc��URSS5 SUlUR(aURRS5 gg)Nr�r��CLOSED�r�r�r�r	�rFrs  r�connection_lost�MyProto.connection_lost<s7�����;��.���
��9�9��I�I� � ��&�r�r�r�r�r�r)rrrrr�r�r�r�r�r�r�rrrrr�r�!s(���D�C�S�H�!��'rr�c�@�\rSrSrSrS
SjrSrSrSrSr	Sr
S	rg)�MyDatagramProtoiCNc�Z�SUlSUlU(aUR5Ulggr�)r�r�rr�)rFrrbs   rr��MyDatagramProto.__init__Fs(����
������*�*�,�D�I�rc�^�URU:wa[SUR<SU<35egr�r�r�s  rr��MyDatagramProto._assert_stateLs/���:�:��!� �7�4�:�:�.��X�L�!Q�R�R�"rc�@�XlURS5 SUlg)Nr��INITIALIZED)r�r�r�r�s  rr��MyDatagramProto.connection_madePs��"�����9�%�"��
rc�b�URS5 U=R[U5-
slg�Nr�r�)rFr��addrs   r�datagram_received�!MyDatagramProto.datagram_receivedUs"�����=�)����s�4�y� �rc�&�URS5 gr�)r�r�s  r�error_received�MyDatagramProto.error_receivedYs�����=�)rc��URS5 SUlUR(aURRS5 gg)Nr�r�r�r�s  rr��MyDatagramProto.connection_lost\s5�����=�)���
��9�9��I�I� � ��&�rr�)FN)rrrrr�r�r�r�r�r�r�rrrrr�r�Cs&���D�-�S�#�
!�*�'rr�c�.^�\rSrSrU4Sjr\R"S5S5r\S5r	\S5r
\S5rSrS	r
S
rSr\R""\"\S5S
5S5r\R""\R,S5S5rSrSrSrSr\S5rSr\S5rSr\R""\R,S5\R@"\!RDRGS5S5\S555r$\S5r%\S5r&\\R@"\'RP=(a \"RR"5RTS:S5S 55r+S!r,\S"5r-S#r.S$r/S%r0S&r1S'r2S(r3S)r4S*r5\S+5r6\S,5r7\S-5r8\S.5r9S/r:S0r;S1r<\S25r=\R""\R,S35S45r>\S55r?S6r@\S75rAS8rB\R""\"\S95S:5S;5rC\R�S<5rES=rF\R@"\!RDS>:HS?5S@5rG\SA5rH\SB5rISCrJ\R"SD5SE5rKSFrL\R"SD5SG5rMSHrNU=rO$)I�BaseEventLoopWithSelectorTestsicc�>�[TU]5 [R"5UlURUR5 gr)r_r`r�SelectorEventLooprbrfrgs �rr`�$BaseEventLoopWithSelectorTests.setUpes.���
��
���-�-�/��	����D�I�I�&rzsocket.getnameinfoc��SUlURRURRS55nUR	US5 g)Nc��g)N�*r)r�s rr��ABaseEventLoopWithSelectorTests.test_getnameinfo.<locals>.<lambda>ls��"r)�abcrqr�)�side_effectrbr��getnameinforB)rF�m_gai�rs   r�test_getnameinfo�/BaseEventLoopWithSelectorTests.test_getnameinfojs=��,����I�I�(�(����)>�)>�|�)L�M������B�rc�(^^^	^
�"SS[R5nSm	U	U4SjnSm
SS/mUU
4SjnXAlUTRlTRRUS	S
5nTR
[5nTRRU5 SSS5 TR[WR5S5 Sm
TRRUS	S
SS
9nTR
[5nTRRU5 SSS5 TRUR[5 URRHnTRU[5 M g!,(df   N�=f!,(df   Ns=f)Nc��\rSrSrSrg)�VBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors.<locals>.MyProtoisrNrrrrr�r�srbrr�c��# �SS/$7f�N�r=r@�r=)z107.6.106.82�Pr�r��kws  r�getaddrinfo�ZBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors.<locals>.getaddrinfovs���7�7�9�
9���c�F>�TRRT"U0UD65$r�rbr��r��kwdsr�rFs  ��r�getaddrinfo_task�_BaseEventLoopWithSelectorTests.test_create_connection_multiple_errors.<locals>.getaddrinfo_taskz�"����9�9�(�(��d�)C�d�)C�D�Drr��err1�err2c�*>�TS-
m[TT5erC)�OSError)r�r��errors�idxs  ��r�_socket�VBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors.<locals>._socket�s����1�H�C��&��+�&�&r�example.comr�zMultiple exceptions: err1, err2T��
all_errors)r�Protocolr)rbr��create_connectionrkr�r�rB�strr��ExceptionGroupr��
exceptions)rFr1r�r�r�r��cm�er�r�r�s`       @@@r�&test_create_connection_multiple_errors�EBaseEventLoopWithSelectorTests.test_create_connection_multiple_errorsps:���	�g�&�&�	�	9�	E����&�!��	'�
"�� 0��	�	���y�y�*�*�7�M�2�F��
�
�
�w�
'�2��I�I�(�(��.�(�	
����R�\�\�*�,M�N����y�y�*�*�7�M�2�RV�*�W��
�
�
�~�
.�"��I�I�(�(��.�/�	
���b�l�l�N�;����(�(�A��!�!�!�W�-�)�(�
'��/�
.�s�>E2�:F�2
F�
Fc�T^�[R"5nX!RlU4SjnUTRl[RRTRS[RS9 TRR[SS5nTR[R5 TRRU5 SSS5 TRURR 5 SSS5 g!,(df   N<=f!,(df   g=f)Nc�>�TRR5n[R[RSSS4nURU/5 U$)Nrr=��	127.0.0.1r�)rbrr)rr#r	)r�r�r
r�rFs    �rr��RBaseEventLoopWithSelectorTests.test_create_connection_timeout.<locals>.getaddrinfo�sE����)�)�)�)�+�C��N�N�F�$6�$6��2�%�'�D��N�N�D�6�"��Jr�sock_connect)r�rr�)rrcr)r0rbr�r6rJr�TimeoutErrorr�r�rkr�r~r}r%)rFr1�sockr�r�s`    r�test_create_connection_timeout�=BaseEventLoopWithSelectorTests.test_create_connection_timeout�s�����y�y�{��'+���$�	�!,��	�	��
�Z�Z�
�
�t�y�y�.�+2�+?�+?��A��9�9�.�.�w��R�H�D��"�"�7�#7�#7�8��	�	�,�,�T�2�9��O�O�D�J�J�-�-�.�A�A�9�8��A�A�s%�5AD�6D�-D�
D	�D�
D'c�^^�SmUU4SjnUTRl[R"S5nSnXClTRR[SSSS9nTR[S	5 TRRU5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)
Nc��# �[R[RSSS4[R[RSSS4/$7f)Nrr=r)�::1r�)r)rr#rr�s  rr��jBaseEventLoopWithSelectorTests.test_create_connection_happy_eyeballs_empty_exceptions.<locals>.getaddrinfo�sB����^�^�V�%7�%7��B�@Q�R��_�_�f�&8�&8�!�R��M�O�
O�s�AA	c�F>�TRRT"U0UD65$rr�r�s  ��rr��oBaseEventLoopWithSelectorTests.test_create_connection_happy_eyeballs_empty_exceptions.<locals>.getaddrinfo_task�r�rz asyncio.staggered.staggered_racec��# �S/4$7frr)�coro_fnsr�rbs   r�	mock_race�hBaseEventLoopWithSelectorTests.test_create_connection_happy_eyeballs_empty_exceptions.<locals>.mock_race�s����R�x��r�r�r�r�)�happy_eyeballs_delayzcreate_connection failed)
rbr�rr6r�r�r�r�rr�)rFr1r��mock_staggeredrr�r�s`     @r�6test_create_connection_happy_eyeballs_empty_exceptions�UBaseEventLoopWithSelectorTests.test_create_connection_happy_eyeballs_empty_exceptions�s����
	O�	E�!1��	�	��
�Z�Z�:�
;�~�
 �)2�&��9�9�.�.�����/�F�D��'�'��6P�Q��	�	�,�,�T�2�R�<�
;�R�Q��<�
;�s$�AB2�4B!�B2�!
B/	�+B2�2
Cc��URR[SS[5S9nUR	[
URRU5 g)Nr�r��r)rbr�r�rJrkrYr��rFr�s  r�%test_create_connection_host_port_sock�DBaseEventLoopWithSelectorTests.test_create_connection_host_port_sock�sB���y�y�*�*��]�B�V�X�+�7�����*�d�i�i�&B�&B�D�Irc�t�[R"[R[R5nU URR	[
US9nUR
[S5 URRU5 SSS5 SSS5 g!,(df   N=f!,(df   g=f�NrzA Stream Socket was expected)	r)rr$rbr�r�r�rYr��rFrr�s   r�!test_create_connection_wrong_sock�@BaseEventLoopWithSelectorTests.test_create_connection_wrong_sock�s����}�}�V�^�^�V�->�->�?��
��9�9�.�.�w�T�.�B�D��'�'�
�(F�H��	�	�,�,�T�2�H��T�H�H���T��#�5B)�+B�B)�
B&	�"B)�)
B7c�t�[R"[R[R5nU URR	[
US9nUR
[S5 URRU5 SSS5 SSS5 g!,(df   N=f!,(df   g=fr)	r)rr$rb�
create_serverr�r�rYr�r s   r�test_create_server_wrong_sock�<BaseEventLoopWithSelectorTests.test_create_server_wrong_sock�s����}�}�V�^�^�V�->�->�?��
��9�9�*�*�7��*�>�D��'�'�
�(F�H��	�	�,�,�T�2�H��T�H�H���T�r#c���URR[SSSS9nUR[S5 URRU5 SSS5 g!,(df   g=f�Nr�r�r@)�ssl_handshake_timeoutz1ssl_handshake_timeout is only meaningful with ssl)rbr%r�r�rYr�rs  r�/test_create_server_ssl_timeout_for_plain_socket�NBaseEventLoopWithSelectorTests.test_create_server_ssl_timeout_for_plain_socket�sa���y�y�&�&��]�B�a�'�A��
�
#�
#��C�E�
�I�I�(�(��.�E�E�E���A�
A*�
SOCK_NONBLOCKz$no socket.SOCK_NONBLOCK (linux only)c��[R"[R[R[R-5nU URRSUS9nURR
U5nUR5 URR
UR55 SSS5 g!,(df   g=f)Nc��grrrrrr��RBaseEventLoopWithSelectorTests.test_create_server_stream_bittype.<locals>.<lambda>�s��4rr)	r)rr#r.rbr%r�r}�wait_closed)rFrr��srvs    r�!test_create_server_stream_bittype�@BaseEventLoopWithSelectorTests.test_create_server_stream_bittype�s����}�}��N�N�F�.�.��1E�1E�E�G��
��9�9�*�*�<�d�*�C�D��)�)�.�.�t�4�C��I�I�K��I�I�(�(����):�;�	�T�T�s
�A0C�
Czno IPv6 supportc�^�U4SjnTRRU"55 g![aOn[[S5(a4UR[R
:XaTR
S5 SnAgeSnAff=f)Nc��P># �[R"SSS5IShv�NnTR[UR5S5 UR5 UR
5IShv�N gNSN!UR5 UR
5IShv�N f=f7f)Nc��grrrrrr��VBaseEventLoopWithSelectorTests.test_create_server_ipv6.<locals>.main.<locals>.<lambda>�s��Trr
r)r�start_server�
assertGreaterrD�socketsr}r2)r3rFs �r�main�DBaseEventLoopWithSelectorTests.test_create_server_ipv6.<locals>.main�s{�����,�,�\�5�!�D�D�C�
(��"�"�3�s�{�{�#3�Q�7��	�	���o�o�'�'�'�E�
(���	�	���o�o�'�'�'�sD�B&�A4�B&�%A8�#B&�.A6�/B&�6B&�8$B#�B�B#�#B&�
EADDRNOTAVAILzfailed to bind to ::1)rbr�r�r*�errnor?�skipTest)rFr=�exs`  r�test_create_server_ipv6�6BaseEventLoopWithSelectorTests.test_create_server_ipv6�sc���	(�	��I�I�(�(���0���	����/�/��H�H�� 3� 3�3��
�
�5�6�6���	�s� *�
B�AA>�=A>�>Bc�V�[R"[R5nU URR[US9nUR[S5 URRU5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)NrzA datagram socket was expected)r)rrb�create_datagram_endpointr�r�rYr�r s   r�(test_create_datagram_endpoint_wrong_sock�GBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_wrong_socksx���}�}�V�^�^�,��
��9�9�5�5�g�D�5�I�D��'�'�
�(H�J��	�	�,�,�T�2�J��T�J�J���T�s#�5B�B	�8B�	
B	�B�
B(c��URR[5nUR[URR
U5 gr�rbr�r�rkrYr�rs  r�(test_create_connection_no_host_port_sock�GBaseEventLoopWithSelectorTests.test_create_connection_no_host_port_socks2���y�y�*�*�7�3�����*�d�i�i�&B�&B�D�Irc��^^�SmUU4SjnUTRlTRR[SS5nTR	[
TRRU5 g)Nc��# �/$7frrr�s  rr��YBaseEventLoopWithSelectorTests.test_create_connection_no_getaddrinfo.<locals>.getaddrinfos
����I�s�c�F>�TRRT"U0UD65$rr�r�s  ��rr��^BaseEventLoopWithSelectorTests.test_create_connection_no_getaddrinfo.<locals>.getaddrinfo_taskr�rr�r�)rbr�r�r�rkr�r��rFr�r�r�s`  @r�%test_create_connection_no_getaddrinfo�DBaseEventLoopWithSelectorTests.test_create_connection_no_getaddrinfosS���	�	E�!1��	�	���y�y�*�*�7�M�2�F������T�Y�Y�1�1�4�	9rc�(^^�SmUU4SjnUTRl[R"5TRl[
TRRlTRR[SS5nTR[
TRRU5 TRR[SSSS9nTR[5nTRRU5 SSS5 TRWR[5 TR[URR 5S5 TRURR S[
5 g!,(df   N�=f)	Nc��# �S/$7fr�rr�s  rr��VBaseEventLoopWithSelectorTests.test_create_connection_connect_err.<locals>.getaddrinfo����7�8�8���c�F>�TRRT"U0UD65$rr�r�s  ��rr��[BaseEventLoopWithSelectorTests.test_create_connection_connect_err.<locals>.getaddrinfo_task"r�rr�r�Tr�r@r)rbr�rrcrr�r�r�r�rkr�r�r�r�rBrDr�)rFr�r�r�r�s`   @r�"test_create_connection_connect_err�ABaseEventLoopWithSelectorTests.test_create_connection_connect_errs���	9�	E�!1��	�	��!%�����	�	��-4��	�	���*��y�y�*�*�7�M�2�F������T�Y�Y�1�1�4�	9��y�y�*�*�7�M�2�RV�*�W��
�
�
�~�
.�"��I�I�(�(��.�/�	
���b�l�l�N�;�����R�\�\�4�4�5�q�9����b�l�l�5�5�a�8�'�B�/�
.�s�"F�
Fc�f^^�SmUU4SjnUTRl[R"5TRl[
TRRl[R"5nX1Rl[URlTRR[SS5nTR[
TRRU5 TRR[SSSS9nTR[
TRRU5 g)Nc��# �S/$7fr�rr�s  rr��gBaseEventLoopWithSelectorTests.test_create_connection_connect_non_os_err_close_err.<locals>.getaddrinfo9rXrYc�F>�TRRT"U0UD65$rr�r�s  ��rr��lBaseEventLoopWithSelectorTests.test_create_connection_connect_non_os_err_close_err.<locals>.getaddrinfo_task<r�rr�r�Tr�)rbr�rrcrrr�r)r0r�r}r�r�rkr�)rFr1r�rr�r�s`    @r�3test_create_connection_connect_non_os_err_close_err�RBaseEventLoopWithSelectorTests.test_create_connection_connect_non_os_err_close_err5s����	9�	E�!1��	�	��!%�����	�	��-8��	�	���*��y�y�{��'+���$�!(��
�
���y�y�*�*�7�M�2�F���������5�5�t�	=��y�y�*�*�7�M�2�RV�*�W���������5�5�t�	=rc�L^^�SmUU4SjnUTRl[R"5TRl[
TRRlTRR[SS[RS9nTR[
5 TRRU5 SSS5 TRR[SS[RSS9nTR[5nTRRU5 SSS5 TRWR[5 URR HnTRU[
5 M g!,(df   N�=f!,(df   Ns=f)Nc��# �SS/$7f�N)r=r@r�r=)�0.0.0.1r�)r=r@r�r=)z0.0.0.2r�rr�s  rr��SBaseEventLoopWithSelectorTests.test_create_connection_multiple.<locals>.getaddrinfoO����2�2�4�
4�r�c�F>�TRRT"U0UD65$rr�r�s  ��rr��XBaseEventLoopWithSelectorTests.test_create_connection_multiple.<locals>.getaddrinfo_taskSr�rr�r���familyT)rnr�)rbr�rrcrr�r�r�r�r)rrkr�r�r�r�r�)rFr�r�r�r�r�s`    @r�test_create_connection_multiple�>BaseEventLoopWithSelectorTests.test_create_connection_multipleNs)���	4�	E�!1��	�	��!%�����	�	��-4��	�	���*��y�y�*�*��]�B�v�~�~�+�?��
�
�
�w�
'��I�I�(�(��.�(��y�y�*�*��]�B�v�~�~�$�+�P��
�
�
�~�
.�"��I�I�(�(��.�/�	
���b�l�l�N�;����(�(�A��!�!�!�W�-�)�(�
'��
/�
.�s�$F�F�
F�
F#c	�n^^�SnX!RRlSmUU4SjnUTRl[
R"5TRl[S5TRRl	TRR[SS[RSS9nTR[5nTRRU5 SSS5 TR[!WR"5R%S	55 TRURRR&R(5 TRR[SS[RSS
S9nTR[*5nTRRU5 SSS5 TR-UR"[*5 UR"R.HnTR-U[5 M g!,(df   GN8=f!,(df   Nt=f)Nc�>�USS:Xa[S5nSUlUeg)Nrrh�Err)r��strerror)r��errs  r�bind�^BaseEventLoopWithSelectorTests.test_create_connection_multiple_errors_local_addr.<locals>.bindks(���A�w�)�#��e�n��$����	�$rc��# �SS/$7frgrr�s  rr��eBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors_local_addr.<locals>.getaddrinfosrjr�c�F>�TRRT"U0UD65$rr�r�s  ��rr��jBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors_local_addr.<locals>.getaddrinfo_taskwr�r�Err2r�r��Ni��rn�
local_addrzMultiple exceptions: T)rnrr�)r)r0rvrbr�rrcrr�r�r�r�rrkr�r~r�r��
startswithr}r%r�r�r�)rFr1rvr�r�r�r�r�s`      @r�1test_create_connection_multiple_errors_local_addr�PBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors_local_addrhs����	�-1���$�$�)�	4�	E�!1��	�	��!%�����	�	��-4�V�_��	�	���*��y�y�*�*��]�B�v�~�~�#�+�%���
�
�w�
'�2��I�I�(�(��.�(�	
����B�L�L�)�4�4�5L�M�N�������4�4�:�:�A�A�B��y�y�*�*��]�B�v�~�~�#��+�6���
�
�~�
.�"��I�I�(�(��.�/�	
���b�l�l�N�;����(�(�A��!�!�!�W�-�)�(�
'��/�
.�s�H�H&�
H#�&
H4c�&�U(dU?[RUlURRn[R
"5URl[R
"5URlURR[RSS5nURRU5upVURRS5 URRupxUR!USUR"5 UR!USUR$5 UR'5 [(R*"UR5 [,R.(Ga+[R0UlURR[RSS5nURRU5upVURRSun	U	SSup�UR5U
S	5 UR!US5 URRupxUR!USUR05 UR!USUR$5 UR'5 [(R*"UR5 gg!UR'5 [(R*"UR5 f=f!UR'5 [(R*"UR5 f=f)
Nr?r��r?r�rnr�r
rr=z	::(0\.)*1)r'r)r�r0rrcrb�_add_reader�_add_writerr�rr�r��connectr�r$rBrr#r}r.r�r
rErrn�assertRegex)rFr1�allow_inet_ptonrr�r(�p�_r��address�host�ports            r�_test_create_connection_ip_addr�>BaseEventLoopWithSelectorTests._test_create_connection_ip_addr�s0����"�%�1�1������+�+�� $�	�	���	�	�� $�	�	���	�	���y�y�*�*�7�+;�+;�Y��K���y�y�+�+�D�1���	.��L�L�+�+�O�<� ���1�1�I�A����V�H�-�x�/?�/?�@����V�F�^�X�-A�-A�B�
�G�G�I��"�"�4�9�9�-��%�%�%� �/�/�D�K��9�9�.�.�w�/?�/?���K�D��9�9�/�/��5�D�A�

2�!�L�L�2�2�1�5�	��$�R�a�[�
��� � ��|�4�� � ��r�*�$�O�O�5�5�	��� � ���!1�8�3D�3D�E�� � �����1E�1E�F����	��&�&�t�y�y�1�#&��
�G�G�I��"�"�4�9�9�-��$���	��&�&�t�y�y�1�s�A1J)�BK�)2K�2L�aixzDbpo-25545: IPv6 scope id and getaddrinfo() behave differently on AIXc�R�[RUlURRn[RUl[
R"5URl[
R"5URl	URR[RSS5nURRU5upEURRS5 URR upgUR#USUR5 UR#USUR$5 UR'5 [(R*"UR5 g!UR'5 [(R*"UR5 f=f)Nz	fe80::1%1r�)zfe80::1r�rr@rnr�)r)r�r0rrnrrcrbr�r�r�rr�r�r�r�r$rBr#r}r.r�)rFr1rr�r(r�r�r�s        r�!test_create_connection_ipv6_scope�@BaseEventLoopWithSelectorTests.test_create_connection_ipv6_scope�s��
 &�1�1������+�+���o�o��� $�	�	���	�	�� $�	�	���	�	���y�y�*�*�7�+;�+;�[�"�M���y�y�+�+�D�1���	.��L�L�+�+�,A�B� ���1�1�I�A����V�H�-�x�/@�/@�A����V�F�^�X�-A�-A�B�
�G�G�I��"�"�4�9�9�-��
�G�G�I��"�"�4�9�9�-�s
�A1E4�42F&c�(�URUS5 gr�r�rWs  r�test_create_connection_ip_addr�=BaseEventLoopWithSelectorTests.test_create_connection_ip_addr�s���,�,�X�t�<rc�(�URUS5 gr�r�rWs  r�#test_create_connection_no_inet_pton�BBaseEventLoopWithSelectorTests.test_create_connection_no_inet_pton�s���,�,�X�u�=r�z9Issue gh-71123: this fails on Android before API level 23c�@�[RUlURRn[R"5UR
l[R"5UR
lSH�up4UR
R[RSU5nUR
RU5upgURRSU45 URRup�URU	SUR 5 URU	SUR"5 UR%5 [&R("UR
5 M� SHgnUR
R[RSU5nUR+[,5 UR
RU5 SSS5 Mi g!UR%5 [&R("UR
5 f=f!,(df   M�=f)N))�httpr�)shttpr�rrnr�)�nonsensesnonsense)r)r�r0rrcrbr�r�r�rr�r�r�r�r$rBrr#r}r.r�rkr�)
rFr1r�servicer�r�r(r�r�r�s
          r�#test_create_connection_service_name�BBaseEventLoopWithSelectorTests.test_create_connection_service_name�s��� &�1�1������+�+�� $�	�	���	�	�� $�	�	���	�	��8�M�G��9�9�.�.�w�/?�/?�/:�G�E�D��9�9�/�/��5�D�A�
2����/�/��d�0C�D�$�O�O�5�5�	��� � ���!1�8�3C�3C�D�� � �����1E�1E�F����	��&�&�t�y�y�1�9�/�G��9�9�.�.�w�/?�/?�/:�G�E�D��"�"�7�+��	�	�,�,�T�2�,�+�	/�����	��&�&�t�y�y�1��,�+�s�A3G�0H�2H�
H	c��^^�SmUU4SjnUTRlTRR[SS[R
SS9nTR
[TRRU5 g)Nc��"# �US:XaSS/$/$7f)Nr�r�r)r�r�r�s   rr��XBaseEventLoopWithSelectorTests.test_create_connection_no_local_addr.<locals>.getaddrinfo�s$����}�$�;�;�=�=��	�s�
c�F>�TRRT"U0UD65$rr�r�s  ��rr��]BaseEventLoopWithSelectorTests.test_create_connection_no_local_addr.<locals>.getaddrinfo_taskr�rr�r�r}r~)	rbr�r�r�r)rrkr�r�rRs`  @r�$test_create_connection_no_local_addr�CBaseEventLoopWithSelectorTests.test_create_connection_no_local_addr�sd���	�	E� 0��	�	���y�y�*�*��]�B�v�~�~�#�+�%��	
����T�Y�Y�1�1�4�	9rc�^^�SmUU4SjnX!lUR5nTRRUT5nTRR	U5 g)N)z00:01:02:03:04:05r@c�>>�TRX4T5 SSSSTS44/$)Ni�r@r=)rB)r�r�r�r�r�rFs    ��rr��TBaseEventLoopWithSelectorTests.test_create_connection_bluetooth.<locals>.getaddrinfos-������d�\�4�0��!�S�"�t�Q�i�0�1�1r)r�r)rbrr�)rFr1r�rr�r�s`    @r� test_create_connection_bluetooth�?BaseEventLoopWithSelectorTests.test_create_connection_bluetoothsK���(��	2� +����� ���y�y�%�%�d�D�1���	�	�$�$�T�*rc�*^^	�[R"5TRlU4SjnUTRRl[R"5TRlTRR
5TRR
lTRR
RRS5 [R"5TRl	"SS5m	U	4SjnUTRRl[Rn[5n[5nTRRR5 TRR[SSSUUS9nTRRU5upxUR!5 TRRR#X3X3S	SUUS
9 TRRR5 TRR[SSSSUUS9nTRRU5upxUR!5 TRRR#X3X3S	SUUS
9 TRRR5 TRR[SSSS
UUS9nTRRU5upxUR!5 TRRR#X3X3S	S
UUS
9 g)Nc�>�TRR5nUR[R[R
[RSS4/5 U$)Nr=r�)rbrr	r)rr#�SOL_TCP)r�r�r7rFs   �r�mock_getaddrinfo�kBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_default.<locals>.mock_getaddrinfosL����	�	�'�'�)�A�
�L�L�6�>�>�6�+=�+=�!�>�>�2��@�A�
B��Hrc�$�\rSrSrSrSrSrSrg)�qBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_default.<locals>._SelectorTransportMocki*Nc�,�[R"5$r)rrc)rF�keys  r�get_extra_infoڀBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_default.<locals>._SelectorTransportMock.get_extra_info-s���y�y�{�"rc�8�URR5 gr)�_sockr}r�s rr}�wBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_default.<locals>._SelectorTransportMock.close0s���
�
� � �"rr)rrrrr�r�r}rrrr�_SelectorTransportMockr�*s���E�
#�
#rr�c�D>�URS5 T"5nXlU$r)r	r�)r�protocol�
sslcontext�waiterr�r�r�s      �r�mock_make_ssl_transport�rBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_default.<locals>.mock_make_ssl_transport3s$������d�#�.�0�I�"�O��r�
python.orgr�T)�sslr*�ssl_shutdown_timeoutF)�server_side�server_hostnamer*r�zperl.com)r�r�r*r�r=)rrcrbr�r�rrr0r	rn�ANYrJr�r�r�r�r}r�)
rFr�r�r��handshake_timeout�shutdown_timeoutr�r�r�r�s
`        @r�2test_create_connection_ssl_server_hostname_default�QBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_defaults���� $�	�	���	�	��	�-=��	�	���)�!%�����	�	��.2�i�i�.E�.E�.G��	�	���+��	�	���+�+�6�6�t�<�(,�	�	���	�	�%�	#�	#�	�5L��	�	�%�%�1��h�h��"�H��!�8���	�	�%�%�0�0�2��y�y�*�*���r�t�&7�%5�+�7���y�y�3�3�D�9��	������	�	�%�%�8�8��c��(�"3�!1�	9�	3�	
�	�	�%�%�0�0�2��y�y�*�*���r�t� *�&7�%5�	+�7��
�y�y�3�3�D�9��	������	�	�%�%�8�8��c��&�"3�!1�	9�	3�	
�	�	�%�%�0�0�2��y�y�*�*���r�t� "�&7�%5�	+�7��
�y�y�3�3�D�9��	������	�	�%�%�8�8��#�!� "�&7�%5�	9�	7rc�0�URR[SSSS9nUR[URR
U5 URR[SSSS9nUR[URR
U5 g)Nr�r�r=)r�rJrs  r�4test_create_connection_no_ssl_server_hostname_errors�SBaseEventLoopWithSelectorTests.test_create_connection_no_ssl_server_hostname_errorsks���y�y�*�*�7�L�"�;=�+�?�����*�d�i�i�&B�&B�D�I��y�y�*�*�7�L�"�;G�+�I�����*�d�i�i�&B�&B�D�Irc�(�URR[SSSS9nUR[URR
U5 URR[SSSS9nUR[URR
U5 [R"5nURR[SSSUS9nURUR5 UR[URR
U5 g)Nr=r�T)r�)r�r)	rbr�r�rkrYr�r)rXr})rFr�rs   r�1test_create_connection_ssl_server_hostname_errors�PBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_errorsts����y�y�*�*�7�B���*�E�����*�d�i�i�&B�&B�D�I��y�y�*�*�7�D�"�$�*�G�����*�d�i�i�&B�&B�D�I��}�}����y�y�*�*�7�D�$�/3�$�+�@������
�
�#����*�d�i�i�&B�&B�D�Irc���URR[SSSS9nUR[S5 URRU5 SSS5 g!,(df   g=fr))rbr�r�r�rYr�rs  r�3test_create_connection_ssl_timeout_for_plain_socket�RBaseEventLoopWithSelectorTests.test_create_connection_ssl_timeout_for_plain_socket�sa���y�y�*�*��]�B�a�+�A��
�
#�
#��C�E�
�I�I�(�(��.�E�E�E�r-c�^^^�[5mU4SjmUU4SjnUTRlTRR[SS5nTR[TRRU5 TRT5 g)Nc��># �USm/$7frZr)r�r�r�s  �rr��QBaseEventLoopWithSelectorTests.test_create_server_empty_host.<locals>.getaddrinfo�s������7�D��I�s�c�F>�TRRT"U0UD65$rr�r�s  ��rr��VBaseEventLoopWithSelectorTests.test_create_server_empty_host.<locals>.getaddrinfo_task�r�rr=r)	rJrbr�r%r�rkr�r�rD)rFr�r
r�r�s`  @@r�test_create_server_empty_host�<BaseEventLoopWithSelectorTests.test_create_server_empty_host�se����x��	�
	E�!1��	�	���i�i�%�%�g�r�1�5�����'�4�9�9�#?�#?��E����$�rc��URR[SS[5S9nUR	[
URRU5 g)N�0.0.0.0rr)rbr%r�rJrkrYr��rFr
s  r�!test_create_server_host_port_sock�@BaseEventLoopWithSelectorTests.test_create_server_host_port_sock�sB���i�i�%�%��Y����&�2�����*�d�i�i�&B�&B�C�Hrc��URR[5nUR[URR
U5 gr)rbr%r�rkrYr�r�s  r�$test_create_server_no_host_port_sock�CBaseEventLoopWithSelectorTests.test_create_server_no_host_port_sock�s2���i�i�%�%�g�.�����*�d�i�i�&B�&B�C�Hrc�Z�[R"5=oRlURR	5UlUR
R
S5 URR[SS5nUR[URRU5 g)Nr�r)rrcrbr�rr0r	r%r�rkr�r�)rFr�r7s   r�!test_create_server_no_getaddrinfo�@BaseEventLoopWithSelectorTests.test_create_server_no_getaddrinfo�st��.2�i�i�k�9��i�i�+�#'�9�9�#:�#:�#<�� �� � �+�+�D�1��I�I�#�#�G�\�1�=�����'�4�9�9�#?�#?��Crc��[RUlU?[R"5URlURR[SSSS9nUR[URRU5 g)Nr�rT��
reuse_port)r)r��SO_REUSEPORTrrcr0rbr%r�rkrYr��rFr1r7s   r� test_create_server_nosoreuseport�?BaseEventLoopWithSelectorTests.test_create_server_nosoreuseport�sh��%�1�1����!�'+�y�y�{����$��I�I�#�#��Y��d�
$�
4��	
���*�d�i�i�&B�&B�A�Frc��[RUl[R"5URlSUlURR[SSSS9nUR[URRU5 g)Nr�r�rTr�)r)r�rrcr0r�rbr%r�rkrYr�r�s   r�+test_create_server_soreuseport_only_defined�JBaseEventLoopWithSelectorTests.test_create_server_soreuseport_only_defined�sj��%�1�1���'+�y�y�{����$� "����I�I�#�#��Y��d�
$�
4��	
���*�d�i�i�&B�&B�A�Frc��"SS[5nS/URl[R"5=o1R
lX#RlURR[SS5nUR[URRU5 URURR5 g)Nc��\rSrSrSrSrg)�HBaseEventLoopWithSelectorTests.test_create_server_cant_bind.<locals>.Erri�r�rN)rrrrrtrrrrrsr��s���Hrrs)r=r@r�r=)rit'r�r)r�r�r0rrcr)rvr�rbr%r�rkr�r~r}r%�rFr1rs�m_sockr
s     r�test_create_server_cant_bind�;BaseEventLoopWithSelectorTests.test_create_server_cant_bind�s���	�'�	�
0�-1����)�04�	�	��;����-�"%�����i�i�%�%�g�y�!�<�����'�4�9�9�#?�#?��E�������+�+�,rc��/URlURR[SS9nUR[URRU5 g)N)�	localhostr�r)r�r0rbrFr�rkr�r��rFr1r�s   r�)test_create_datagram_endpoint_no_addrinfo�HBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_no_addrinfo�sN��,.����)��y�y�1�1��(8�2�:������T�Y�Y�1�1�4�	9rc�(�URR[SS9nUR[URR
U5 URR[SS9nUR[URR
U5 g)Nr�r�)r�r@r=rI)rbrFr�rkr�r�rs  r�(test_create_datagram_endpoint_addr_error�GBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_addr_error�s~���y�y�1�1���2�5������t�y�y�3�3�T�	;��y�y�1�1��(>�2�@������t�y�y�3�3�T�	;rc�0�[R"5URl[URRlURR
[RSS9nUR[URRU5 g)N�rr)�remote_addr)rrcrbrr�r�rFr�DatagramProtocolrkr�rs  r�)test_create_datagram_endpoint_connect_err�HBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_connect_err�sk��!%�����	�	��-4��	�	���*��y�y�1�1��$�$�2B�2�D������T�Y�Y�1�1�4�	9rc��^�[SURS9m[R"5=URln/UlURR
U4SjSSS9nURRU5up4URUR5 UR5 URRTR5 URSTR5 g)NT�rrbc�>�T$rr)r�s�rr��^BaseEventLoopWithSelectorTests.test_create_datagram_endpoint_allow_broadcast.<locals>.<lambda>�s���Hrr)r�allow_broadcastr�)r�rbrrcrr0rFr�r{r%r}r�rBr�)rFrr�r�r�r�s     @r�-test_create_datagram_endpoint_allow_broadcast�LBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_allow_broadcast�s����"��D�I�I�F��04�	�	��;��	�	���$&��!��y�y�1�1��(� �2�"��
�y�y�3�3�D�9��	�����,�,�-������	�	�$�$�X�]�]�3�����8�>�>�2rc��[RUl[URlURR[R[RS9nUR[URRU5 URR[RSS9nUR[URRU5 g)Nrmrr�)r)r�r�r�rbrFrrrrkr�r�s   r�(test_create_datagram_endpoint_socket_err�GBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_socket_err�s���%�1�1���&-����#��y�y�1�1��$�$�V�^�^�2�=������T�Y�Y�1�1�4�	9��y�y�1�1��$�$�1A�2�C������T�Y�Y�1�1�4�	9rzIPv6 not supported or enabledc��URR[RSSS9nUR	[
URRU5 g)Nr)r
r)rr�rbrFrrrkrYr�rs  r�0test_create_datagram_endpoint_no_matching_family�OBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_no_matching_familysK���y�y�1�1��$�$�(�Z�2�A��	
�����	�	�4�4�d�	<rc��[URRRlUR
R
[R[RS9nUR[UR
RU5 URURRRR5 g)Nrm)r�r)r0�setblockingr�rbrFrrrrkr�r~r}r%r�s   r�(test_create_datagram_endpoint_setblk_err�GBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_setblk_errs���?F����$�$�0�0�<��y�y�1�1��$�$�V�^�^�2�=������T�Y�Y�1�1�4�	9�����O�O�(�(�.�.�5�5�	7rc��URR[R5nUR	[
URRU5 grrrs  r�-test_create_datagram_endpoint_noaddr_nofamily�LBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_noaddr_nofamilys;���y�y�1�1��$�$�&�����*�d�i�i�&B�&B�D�Irc��"SS[5n[RUl[R"5=o1RlX#RlURR[S[RS9nURX RRU5 URURR 5 g)Nc��\rSrSrSrg)�SBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_cant_bind.<locals>.Erri%rNrrrrrsr %rbrrsr)rrn)r�r)r�rrcr0rvr�rbrFr�rrkr�r~r}r%r�s     r�'test_create_datagram_endpoint_cant_bind�FBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_cant_bind#s���	�'�	� &�1�1���04�	�	��;����-�"%�����i�i�0�0��'����1�@��	
���#�y�y�;�;�S�A�������+�+�,rc�^�[R"[R[R5nURS5 TRRU4SjUS9nTRR
U5up4UR5 TRR
UR5 TRSUR5 g)Nrc�,>�[STRS9$�NTr
�r�rbr�s�rr��SBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock.<locals>.<lambda>6����O�$�T�Y�Y�Grrr�)r)rr$rvrbrFr�r}r�rBr�)rFrr
r�r�s`    r�"test_create_datagram_endpoint_sock�ABaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock2s�����}�}�V�^�^�V�->�->�?���	�	�"�#��i�i�0�0�G��1���#�i�i�:�:�3�?��	������	�	�$�$�X�]�]�3�����8�>�>�2r�AF_UNIXzNo UNIX Socketsc�^�TRRU4Sj[RS9nTRR	U5up#TRURR[R5 UR5 TRR	UR5 TRSUR5 g)Nc�,>�[STRS9$r%r&r�s�rr��XBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock_unix.<locals>.<lambda>@r(rrmr�)rbrFr)r+r�rBr�rnr}r�r�)rFr
r�r�s`   r�'test_create_datagram_endpoint_sock_unix�FBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock_unix=s�����i�i�0�0�G��>�>�1�#��#�i�i�:�:�3�?��	�������/�/����@������	�	�$�$�X�]�]�3�����8�>�>�2rc�^�[R"5n[R"[R[RS9nURU5 UR
5 TRRU4SjU[RS9nTRRU5upEUR
5 TRRUR5 SSS5 g!,(df   g=f)N)r�c�,>�[STRS9$r%r&r�s�rr��aBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_existing_sock_unix.<locals>.<lambda>Ps����d����Krrm)r.�unix_socket_pathr)r+r$rvr}rbrFr�r�)rF�pathrr�r�r�s`     r�0test_create_datagram_endpoint_existing_sock_unix�OBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_existing_sock_unixHs����
�
(�
(�
*�d��=�=����f�6G�6G�H�D��I�I�d�O��J�J�L��9�9�5�5�K��V�^�^�6�-�D�#'�)�)�">�">�t�"D��I��O�O���I�I�(�(����7�+�
*�
*�s�CC2�2
Dc�j�"SS5nURR[SU"5S9nUR[URR
U5 URR[SU"5S9nUR[URR
U5 URR[SU"5S9nUR[URR
U5 URR[SU"5S9nUR[URR
U5 URR[SU"5S	9nUR[URR
U5 URR[S
U"5S9nUR[URR
U5 URR[S
U"5S9nUR[URR
U5 g)
Nc�,�\rSrSr\R
rSrg)�\BaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock_sockopts.<locals>.FakeSockiWrN)rrrrr)r$r�rrrr�FakeSockr:Ws
���$�$�Drr;r)rr)rrr@)rnr)�protor)�flagsrT)r�r)r
r)rbrFr�rkrYr�)rFr;r
s   r�+test_create_datagram_endpoint_sock_sockopts�JBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock_sockoptsVs���	%�	%��i�i�0�0��(8�x�z�1�K�����*�d�i�i�&B�&B�C�H��i�i�0�0��)9��
�1�L�����*�d�i�i�&B�&B�C�H��i�i�0�0��A�H�J�1�8�����*�d�i�i�&B�&B�C�H��i�i�0�0��1�8�:�1�7�����*�d�i�i�&B�&B�C�H��i�i�0�0��1�8�:�1�7�����*�d�i�i�&B�&B�C�H��i�i�0�0���8�:�1�?�����*�d�i�i�&B�&B�C�H��i�i�0�0��T��
�1�D�����*�d�i�i�&B�&B�C�Hr�vxworksz-SO_BROADCAST is enabled by default on VxWorksc�^�TRRU4SjSS9nTRRU5up#URS5n[	[
S5nU(a=TR
UR[
R[
R55 TR
UR[
R[
R55 UR5 TRRUR5 TRSUR5 TRRU4SjSUSS	9nTRRU5up#URS5nTR
UR[
R[
R55 U(a=TR!UR[
R[
R55 TR!UR[
R[
R55 UR5 TRRUR5 TRSUR5 g)
Nc�,>�[STRS9$r%r&r�s�rr��WBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sockopts.<locals>.<lambda>}r(rrr�r)r�r�c�,>�[STRS9$r%r&r�s�rr�rC�r(rT)rr�r
)rbrFr�r�r*r)r{�
getsockoptr%r��SO_BROADCASTr}r�rBr�r&r~)rFr�r�r�r�reuseport_supporteds`     r�&test_create_datagram_endpoint_sockopts�EBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sockoptsvs�����y�y�1�1�G�'�2�)��#�i�i�:�:�4�@��	��'�'��1��%�f�n�=����������%�%�v�':�':�<�
=�	
����O�O��!�!�6�#6�#6�
8�	9�	�����	�	�$�$�X�]�]�3�����8�>�>�2��y�y�1�1�G�'�*� �	2�"��
#�i�i�:�:�4�@��	��'�'��1������O�O��!�!�6�#6�#6�
8�	9���O�O�����%�%�v�':�':�<�
=�	
����O�O��!�!�6�#6�#6�
8�	9�	�����	�	�$�$�X�]�]�3�����8�>�>�2rc��^�U?[R"5URlTR
R
U4SjSSS9nTR[TR
RU5 g)Nc�*>�[TRS9$r�r&r�s�rr��\BaseEventLoopWithSelectorTests.test_create_datagram_endpoint_nosoreuseport.<locals>.<lambda>�����O����3rrT�rr�)
r�rrcr)r0rbrFrkrYr�r�s`  r�+test_create_datagram_endpoint_nosoreuseport�JBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_nosoreuseport�s[����!�'+�y�y�{����$��y�y�1�1�3�'��2���
	
���*�d�i�i�&B�&B�D�Irc�^�U4SjnX!l[R"5=URRln[R"5TRl[[S5nTRRU4SjSUS9nTRRU5upgURS5 URRURURURS9 UR5 [ R""TR5 g!UR5 [ R""TR5 f=f)Nc�(>�TRS5 g)Nz"should not have called getaddrinfo)�fail)r�r�rFs  �rr��YBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_ip_addr.<locals>.getaddrinfo�s����I�I�:�;rr�c�*>�[TRS9$r�r&r�s�rr��VBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_ip_addr.<locals>.<lambda>�rMrrQrN)rnr<r�)r�rrcr)r0rvrbr�r*rFr�r�rr"r$r}r.r�)rFr1r�rvrGr�r(r�s`       r�%test_create_datagram_endpoint_ip_addr�DBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_ip_addr�s���	<� +��37�9�9�;�>����$�$�)�D� $�	�	���	�	��%�f�n�=���y�y�1�1�3�%�*�2�,��
�y�y�+�+�D�1���	.��#�#�N�3��O�O�.�.�h�6F�6F�5=�5I�5I�4<�4G�4G�
/�
I�
�G�G�I��"�"�4�9�9�-��
�G�G�I��"�"�4�9�9�-�s
�/A
D*�*2Ec���[R"5n[5URlUR
R
[U5 URURR5 gr)rrc�BlockingIOError�acceptr�rb�_accept_connectionr�r{r}r%�rFrs  r�test_accept_connection_retry�;BaseEventLoopWithSelectorTests.test_accept_connection_retry�sH���y�y�{��"1�"3������	�	�$�$�W�d�3�������*�*�+rr�c�>�[R"5nSURl[	[
RS5URl[R"5URl
[R"5URlURR[U5 URURR 5 UR#UR$R 5 URRR'S5 URRR'[(R*[R,[USS[R,[R,[R,5	 g)NrazToo many open files)rrc�filenor0r�r@�EMFILEr[r�rb�_remove_readerr�r\r�r~r�r%r{r}r�r�ACCEPT_RETRY_DELAYr�)rF�m_logrs   r� test_accept_connection_exception�?BaseEventLoopWithSelectorTests.test_accept_connection_exception�s����y�y�{��#%���� �")�%�,�,�8M�"N�����#'�9�9�;��	�	� �#�y�y�{��	�	���	�	�$�$�W�d�3�������*�*�+�������*�*�+��	�	� � �3�3�B�7��	�	���/�/��(�(��H�H��T�4��t�x�x����4�8�8�		Erc��SnURRS5 UnU"5nURUR5 X#4GHXnUR	[
5 URR
U5 SSS5 UR	[
5 URRU5 SSS5 UR	[
5 URRSU5 SSS5 UR	[
5 URRURR5S-U5 SSS5 UR	[
5 URRURRSU55 SSS5 GM[ g!,(df   GN0=f!,(df   GN	=f!,(df   N�=f!,(df   N�=f!,(df   GM�=f)Nc��# �g7frrrrr�simple_coroutine�LBaseEventLoopWithSelectorTests.test_call_coroutine.<locals>.simple_coroutine�r�r�Tr)
rbr�rXr}rkr�r�rr�r�r�r�r�)rFrj�	coro_func�coro_objr5s     r�test_call_coroutine�2BaseEventLoopWithSelectorTests.test_call_coroutine�sK��	�	
�	�	���D�!�$�	��;��������'��)�D��"�"�9�-��	�	�#�#�D�)�.��"�"�9�-��	�	�.�.�t�4�.��"�"�9�-��	�	�$�$�R��.�.��"�"�9�-��	�	�!�!�$�)�)�.�.�"2�R�"7��>�.��"�"�9�-��	�	�,�,��I�I�-�-�d�D�9�;�.�-�*�-�-��-�-��-�-��-�-��-�-�s<�F$�F6�G�8G� 6G*�$
F3	�6
G	�
G	�
G'	�*
G:	c��SnSn[R"UR5 URRS5 SURlURRX R5 URR
5 URRStpEURU[U5-S5 [R"U"UR5URS9 URR
5 URRStpEURU[U5-S5 g)	Nc�$�UR5 gr�r�r�s r�stop_loop_cb�LBaseEventLoopWithSelectorTests.test_log_slow_callbacks.<locals>.stop_loop_cb�s���I�I�Krc��,# �UR5 g7frrrr�s r�stop_loop_coro�NBaseEventLoopWithSelectorTests.test_log_slow_callbacks.<locals>.stop_loop_coro�s����I�I�K���Tgrz4^Executing <Handle.*stop_loop_cb.*> took .* seconds$r�z4^Executing <Task.*stop_loop_coro.*> took .* seconds$)rrfrbr��slow_callback_durationr�r��warningr$r��tupler�)rF�m_loggerrsrv�fmtr�s      r�test_log_slow_callbacks�6BaseEventLoopWithSelectorTests.test_log_slow_callbacks�s��	�	�	���t�y�y�)��	�	���D�!�+.��	�	�(�	
�	�	���L�)�)�4��	�	�����%�%�/�/��2�
������u�T�{�*�,�	-�
	���n�T�Y�Y�7�d�i�i�H��	�	�����%�%�/�/��2�
������u�T�{�*�,�	-rr�)Prrrrr`rr6r�r8r�r	rrr!r&r+�unittest�
skipUnlessr*r)r4r
rErCrGrKrSr\rcror�r��skipIfrv�platformr�r�r�r�r�
is_android�android_ver�	api_levelr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrr!r)r/�skip_unless_bind_unix_socketr6r>rHrOrWr^rfrnr~rr�r�s@rr�r�cs����'�

�Z�Z�$�%� �&� �
�%.��%.�N�/��/�(�3��3�:J�
3�3�/�������9�?�A�<�A�<�����3�3�5F�G��H��$3�J�
9�C�.�=��=�0.�4�&.��&.�P'2�R����3�3�5F�G�
�_�_�S�\�\�,�,�U�3�Z�\��.��\�H�.�&�=��=��>��>��
�_�_����D�x�3�3�5�?�?�"�D�C��3�	��
3�89�$�+��+�N7�`J�
J�/� �"I�
I�D��G��G��G��G��-��-��9��9�;�9�3�"�9��9�����3�3�5T�U�<�V�<��7��7�J�
�-��-�	3�������3�5F�G�3�H�3��/�/�8�0�8�I�@�_�_�S�\�\�Y�.�C�E�-3�E�-3�^�	J��	J��.��.�0,�
�Z�Z�,�-�E�.�E�";�*
�Z�Z�,�-�-�.�-rr�c��\rSrSrSrSrg)�RunningLoopTestsic�x�Sn[R"5n[R"5nUR[S5 UR	U"U55 SSS5 UR5 UR5 g!,(df   N/=f!UR5 UR5 f=f)Nc��,# �UR5 g7fr)r�r�s r�runner�@RunningLoopTests.test_running_loop_within_a_loop.<locals>.runners�������rxzwhile another loop is running)rrr�r�r�r})rFr�rb�
outer_loops    r�test_running_loop_within_a_loop�0RunningLoopTests.test_running_loop_within_a_loops���	��%�%�'���+�+�-�
�	��'�'��(G�I��-�-�f�T�l�;�I�
�J�J�L�����I�I��
�J�J�L�����s#�B�B�B�
B�B�"B9rN)rrrrr�rrrrr�r�s��rr�c��^�\rSrSrSS-r"SS\R5r\U4Sj5r	\U4Sj5r
U4SjrSS	jrS
r
SrSrS
rSrSrSrSrSrSrSrSrSrSrU=r$)�BaseLoopSockSendfileTestsi(s�12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcdeic�2�\rSrSrSrSrSrSrSrSr	g)	�!BaseLoopSockSendfileTests.MyProtoi,c�v�SUlSUl[5UlUR	5UlSUlgr�)rj�closed�	bytearrayr�rr
r�)rFrbs  rr��*BaseLoopSockSendfileTests.MyProto.__init__.s0�� �D�L��D�K�!��D�I��)�)�+�D�H�!�D�Nrc��SUlXlgr)rjr�r�s  rr��1BaseLoopSockSendfileTests.MyProto.connection_made5s���D�L�&�Nrc�:�URRU5 gr)r��extendr�s  rr��/BaseLoopSockSendfileTests.MyProto.data_received9s���I�I���T�"rc�V�SUlURRS5 SUlgr)r�r
r	r�r�s  rr��1BaseLoopSockSendfileTests.MyProto.connection_lost<s"���D�K��H�H����%�!�D�Nrc��8# �URIShv�N gN7frr�r�s rr2�-BaseLoopSockSendfileTests.MyProto.wait_closedAs����(�(�N�N�s���)r�r�r
rjr�N)
rrrrr�r�r�r�r2rrrrr�r�,s��	"�	'�	#�	"�
	rr�c�>�[RUlS[l[[R
S5nUR
UR5 SSS5 [TU]%5 g!,(df   N=f)Ni@�wb)
r�!SENDFILE_FALLBACK_READBUFFER_SIZE�'_BaseLoopSockSendfileTests__old_bufsize�openr	�TESTFNr��DATAr_�
setUpClass)�cls�fprhs  �rr��$BaseLoopSockSendfileTests.setUpClassDsT���%�G�G���6?�	�3�
�)�"�"�D�
)�R��H�H�S�X�X��*�
����*�
)�s�A/�/
A=c�>�UR[l[R"[R
5 [TU]5 gr)r�rr�r	�unlinkr�r_�
tearDownClass)r�rhs �rr��'BaseLoopSockSendfileTests.tearDownClassLs0���69�6G�6G�	�3�����)�)�*�
���rc�>�SSKJn U"5UlURUR5 [	[
RS5UlURURR5 [TU]-5 g)Nr)�BaseSelectorEventLoop�rb)�asyncio.selector_eventsr�rbrfr�r	r��filerXr}r_r`)rFr�rhs  �rr`�BaseLoopSockSendfileTests.setUpRsS���A�)�+��	����D�I�I�&���)�)�4�0��	�����	�	���(�
��
�rc���[R"[R[R5nURU5 UR	UR
5 U$r)r)rr#rrXr})rF�blockingrs   r�make_socket�%BaseLoopSockSendfileTests.make_socket[s?���}�}�V�^�^�V�-?�-?�@������"�����
�
�#��rc�8�URRU5$r)rbr�rs  rr��"BaseLoopSockSendfileTests.run_loopas���y�y�+�+�D�1�1rc	�^^^^�TR5mTRTR5mTRTRR	U4Sj[
RS[RS95mTRSR5n[S5H/nTRTRRTU55  O- TRTRRTU55 UUUU4SjnTR!U5 TT4$![a) TR[R"S55 M�f=f)Nc�>�T$rr)r<s�rr��3BaseLoopSockSendfileTests.prepare.<locals>.<lambda>hs���Errrmrag�?c�>�TR5 TR5 TRb9TRR5 TRTR55 TRTR55 gr)r}r�r�r2)r<rF�serverrs����r�cleanup�2BaseLoopSockSendfileTests.prepare.<locals>.cleanupwsY����L�L�N��J�J�L����*����%�%�'��
�
�e�/�/�1�2��M�M�&�,�,�.�/r)r�r�rbr�r%r
�HOSTr)rr<�getsocknamer@rr�rrerX)rFr�r�r�r<r�rs`   @@@r�prepare�!BaseLoopSockSendfileTests.prepareds������!�����T�Y�Y�'�����t�y�y�6�6��=�-�-�q���� 7� I�J���~�~�a� �,�,�.���r��A�
��
�
�d�i�i�4�4�T�4�@�A�
��
�M�M�$�)�)�0�0��t�<�=�	0�	0�	
���� ��U�{���'�
��
�
�g�m�m�C�0�1��
�s�'+D�/E�Ec	��UR5upUR[RS5 UR	UR
R
XRSS55 SSS5 URURS5 URURR5S5 g!,(df   NU=f)N�sendfile is not availablerr)r�r�r�SendfileNotAvailableErrorr�rb�_sock_sendfile_nativer�rBr��tell�rFrr<s   r�"test__sock_sendfile_native_failure�<BaseLoopSockSendfileTests.test__sock_sendfile_native_failure�s����l�l�n���
�
#�
#�G�$E�$E�$?�A��M�M�$�)�)�9�9�$�	�	�:;�T�C�
D�A�
	
������S�)���������)�1�-�
A�A�s�7B9�9
Cc	��UR5upUR[RS5 UR	UR
R
XRSS95 SSS5 URURR5S5 URURS5 g!,(df   NU=f)Nr�F)�fallbackrr)r�r�rr�r�rb�
sock_sendfiler�rBr�r�r�s   r�test_sock_sendfile_no_fallback�8BaseLoopSockSendfileTests.test_sock_sendfile_no_fallback�s����l�l�n���
�
#�
#�G�$E�$E�$?�A��M�M�$�)�)�1�1�$�	�	�;@�2�B�
C�A�
	
��������)�1�-�������S�)�
A�A�s�4B6�6
Cc��UR5upURURRXR55nUR5 URUR
55 URU[UR55 URURR5[UR55 URURUR5 gr)r�r�rbr�r�r}r2rBrDr�r�r��rFrr<�rets    r�test_sock_sendfile_fallback�5BaseLoopSockSendfileTests.test_sock_sendfile_fallback�s����l�l�n����m�m�D�I�I�3�3�D�)�)�D�E���
�
���
�
�e�'�'�)�*�����c�$�)�)�n�-���������)�3�t�y�y�>�:�������T�Y�Y�/rc��UR5upURURRXRSS55nUR5 URUR
55 URUS5 URURR5S5 URURURSS5 g)Ni�i�r<)r�r�rbr�r�r}r2rBr�r�r�r�s    r�,test_sock_sendfile_fallback_offset_and_count�FBaseLoopSockSendfileTests.test_sock_sendfile_fallback_offset_and_count�s����l�l�n����m�m�D�I�I�3�3�D�)�)�48�$�@�A���
�
���
�
�e�'�'�)�*�����d�#���������)�4�0�������T�Y�Y�t�D�%9�:rc� �URRS5 URSS9nUR[S5 URURR
XR55 SSS5 g!,(df   g=f)NT)r�zmust be non-blocking)rbr�r�r�rYr�r�r�r]s  r�test_blocking_socket�.BaseLoopSockSendfileTests.test_blocking_socket�sd���	�	���D�!������.��
�
#�
#�J�0F�
G��M�M�$�)�)�1�1�$�	�	�B�C�H�
G�
G�s�5A?�?
B
c�<�UR5n[[RSS9nUR	[
S5 UR
URRX55 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nzutf-8)�encodingzbinary mode)	r�r�r	r�r�rYr�rbr�)rFrr7s   r�test_nonbinary_file�-BaseLoopSockSendfileTests.test_nonbinary_file�sk�����!��
�)�"�"�W�
5���'�'�
�M�B��
�
�d�i�i�5�5�d�>�?�C�6�
5�B�B��6�
5�s#�B
�+A<�+B
�<
B
	�B
�
Bc��[R"[R[R5nURS5 UR	UR
5 UR
[S5 URURRXR55 SSS5 g!,(df   g=f)NFzonly SOCK_STREAM type)r)rr$rrXr}r�rYr�rbr�r�r]s  r�test_nonstream_socket�/BaseLoopSockSendfileTests.test_nonstream_socket�sw���}�}�V�^�^�V�->�->�?�����������
�
�#�
�
#�
#�J�0G�
H��M�M�$�)�)�1�1�$�	�	�B�C�I�
H�
H�s�65B4�4
Cc	���UR5nUR[S5 URURRXRSS55 SSS5 g!,(df   g=f)N� count must be a positive integerrrR�r�r�r�r�rbr�r�r]s  r�test_notint_count�+BaseLoopSockSendfileTests.test_notint_count�sZ�����!��
�
#�
#�I�$F�H��M�M�$�)�)�1�1�$�	�	�1�g�N�O�H�H�H���7A'�'
A5c	���UR5nUR[S5 URURRXRSS55 SSS5 g!,(df   g=f)Nr�rr��r�r�rYr�rbr�r�r]s  r�test_negative_count�-BaseLoopSockSendfileTests.test_negative_count�sZ�����!��
�
#�
#�J�$F�H��M�M�$�)�)�1�1�$�	�	�1�b�I�J�H�H�H�r�c���UR5nUR[S5 URURRXRS55 SSS5 g!,(df   g=f)N�%offset must be a non-negative integer�offsetr�r]s  r�test_notint_offset�,BaseLoopSockSendfileTests.test_notint_offset�sX�����!��
�
#�
#�I�$K�M��M�M�$�)�)�1�1�$�	�	�8�L�M�M�M�M���6A&�&
A4c���UR5nUR[S5 URURRXRS55 SSS5 g!,(df   g=f)Nr�r�r�r]s  r�test_negative_offset�.BaseLoopSockSendfileTests.test_negative_offset�sX�����!��
�
#�
#�J�$K�M��M�M�$�)�)�1�1�$�	�	�2�F�G�M�M�M�r�)r�rbr)rrrrr�rr�r��classmethodr�r�r`r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�s@rr�r�(s������$�D��'�"�"��0����� �� �
��2��>	.�	*�	0�
;�D�@�D�P�K�N�H�Hrr�c�Z�\rSrSrSr\R"\"\S5S5S5r	Sr
g)�TestSelectorUtilsi�c�,�UR[R[R5nUR	U5 [
R"U5 UR[R[R5nURU5 gr)rEr)r!�TCP_NODELAYr{r�_set_nodelayr~)rFr�opts   r�check_set_nodelay�#TestSelectorUtils.check_set_nodelay�sb���o�o�f�0�0�&�2D�2D�E�������� � ��&��o�o�f�0�0�&�2D�2D�E������rr�zneed socket.TCP_NODELAYc���[R"[R[R[RS9nU UR	U5 SSS5 [R"[R[R[RS9nU URS5 UR	U5 SSS5 g!,(df   N|=f!,(df   g=f)N)rnr�r<F)r)rr#r!rrr]s  r�test_set_nodelay�"TestSelectorUtils.test_set_nodelay�s����}�}�F�N�N��9K�9K�#)�#5�#5�7��
��"�"�4�(���}�}�F�N�N��9K�9K�#)�#5�#5�7��
����U�#��"�"�4�(��T��T��
�T�s�C�#C�
C�
C*rN)rrrrrr�r�r*r)rrrrrr�r��s2���������7�2�4�
)�4�
)rr��__main__).�__doc__�concurrent.futuresr�r@rFr�r)rvr�r�r�rrrr�test.test_asynciorr.rr�test.support.script_helperr�test.supportr	r
rr�r�r
rrr3r8�TestCaser:r[r�r�rr�r�r�r�r�rr=rrr�<module>r
s�������
�
��������1��7�"�&���8�8��	�)�	�(��":�
^H�Z�(�(�^H�BD1��,�,�D1�N'�g���'�D'�g�.�.�'�@q-�Z�%8�%8�q-�h�x�(�(��"qH�
� 3� 3�qH�h)�
�+�+�)�4�z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit