HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/test_asyncio/__pycache__/test_base_events.cpython-37.pyc
B

��g�3�@sndZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl	m
Z
ddlZddlmZddlm
Z
ddlmZddlmZddlmZdd	lmZe
jZejd
kZdd�Zd
d�ZGdd�dej�ZGdd�dej�ZGdd�dej�Z Gdd�dej!�Z"Gdd�dej�Z#Gdd�de	j�Z$Gdd�dej�Z%Gdd�dej�Z&e'dk�rje	�(�dS) zTests for base_events.py�N)�mock)�base_events)�	constants)�events)�utils)�support)�assert_python_ok)��cCsdtjtd�}x4dD],}tt|�r4t||tt|��qt||�qWt��|_t��|j_	d|j
_|S)N)�spec)
�AF_INET�AF_INET6�	AF_UNSPEC�IPPROTO_TCP�IPPROTO_UDP�SOCK_STREAM�
SOCK_DGRAM�
SOL_SOCKET�SO_REUSEADDR�	inet_ptonF)rZ	MagicMock�socket�hasattr�setattr�getattr�delattr�
test_utilsZmock_nonblocking_socket�return_value�getaddrinfo�
_is_coroutine)�m_socket�name�r!�>/usr/local/lib/python3.7/test/test_asyncio/test_base_events.py�mock_socket_modules

r#cCstjdtd�|�S)Nzasyncio.base_events.socket)Znew_callable)r�patchr#)�fr!r!r"�patch_socket-sr&c@s(eZdZdd�Zdd�Zedd��ZdS)�BaseEventTestsc
Cs�tj}tj}tj}tj}tj}tj}tj}|�|||ddft	�
dd|||��|�|||ddft	�
dd|||��|�|||ddft	�
dd|||��|�|||ddft	�
dd|||��|�|||ddft	�
dd||d��|�|||ddft	�
dd||d��|�t	�
dd|dd��|�t	�
dd|||��|�|||ddft	�
dd|||��|�|||ddft	�
dd|||��|�t	�
dd|||��|�t	�
d	d|||��dS)
N�)z1.2.3.4�z1.2.3.4r)s1.2.3.4r)z::3r)rrz::3z::3%lo0)rrrr
rrrr�assertEqualr�_ipaddr_info�assertIsNone)�selfZUNSPEC�INETZINET6�STREAMZDGRAM�TCPZUDPr!r!r"�test_ipaddr_info4sNzBaseEventTests.test_ipaddr_infoc
Cs�tj}tj}tj}|�|||ddft�dd|||��|�|||ddft�dd|||��|�|||ddft�dd|||��|�|||ddft�dd|||��|�|||ddft�dd|||��dS)Nr()z1.2.3.4rz1.2.3.4�)z1.2.3.4r)�1�1)rrrrr*rr+)r-r.r/r0r!r!r"�test_port_parameter_typesos$z(BaseEventTests.test_port_parameter_typesc	Cs&|`|�t�ddtjtjtj��dS)Nz1.2.3.4r))rr,rr+rrrr)r-rr!r!r"�test_ipaddr_info_no_inet_pton�s
z,BaseEventTests.test_ipaddr_info_no_inet_ptonN)�__name__�
__module__�__qualname__r1r5r&r6r!r!r!r"r'2s;r'csfeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Ze�d�d d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&dFdG�Z'dHdI�Z(dJdK�Z)dLdM�Z*dNdO�Z+dPdQ�Z,dRdS�Z-�Z.S)T�BaseEventLoopTestscs<t���t��|_t��|j_d|jjj_	|�
|j�dS)Nr!)�super�setUpr�
BaseEventLoop�loopr�Mock�	_selector�selectr�set_event_loop)r-)�	__class__r!r"r<�s


zBaseEventLoopTests.setUpc	Cs�t��}|�t|jj||�|�t|jj||||�|�t|jj||�|�t|jjg�|�t|jj	�|�t|jj
||�|�t|jj||�|j�|||||||�}|�t��|�
d�WdQRXdS)N)rr?�assertRaises�NotImplementedErrorr>Z_make_socket_transport�_make_ssl_transportZ_make_datagram_transport�_process_events�_write_to_selfZ_make_read_pipe_transportZ_make_write_pipe_transportZ_make_subprocess_transport�send)r-�m�genr!r!r"�test_not_implemented�s.z'BaseEventLoopTests.test_not_implementedcCsr|�|j���|j��|�|j���|j��|j��tj|jd�}|�t|jj	�|�t|jj
|�dS)N)r>)�assertFalser>Z	is_closed�close�
assertTrue�asyncio�FuturerD�RuntimeError�run_forever�run_until_complete)r-r%r!r!r"�
test_close�s


zBaseEventLoopTests.test_closecCsDt�dd�d|jd�}|j�|�|�|jj�|�||jj�dS)NcSsdS)NFr!r!r!r!r"�<lambda>�r2z>BaseEventLoopTests.test__add_callback_handle.<locals>.<lambda>r!)rP�Handler>�
_add_callbackrM�
_scheduled�assertIn�_ready)r-�hr!r!r"�test__add_callback_handle�sz,BaseEventLoopTests.test__add_callback_handlecCsJt�dd�d|jd�}|��|j�|�|�|jj�|�|jj�dS)NcSsdS)NFr!r!r!r!r"rV�r2zHBaseEventLoopTests.test__add_callback_cancelled_handle.<locals>.<lambda>r!)rPrWr>�cancelrXrMrYr[)r-r\r!r!r"�#test__add_callback_cancelled_handle�s
z6BaseEventLoopTests.test__add_callback_cancelled_handlecCs(t��}|j�|�|�||jj�dS)N)rr?r>Zset_default_executor�assertIsZ_default_executor)r-�executorr!r!r"�test_set_default_executor�sz,BaseEventLoopTests.test_set_default_executorcCsDdd�}|j�|�}|�|j|�|�|tj�|�||jj�dS)NcSsdS)Nr!r!r!r!r"�cb�sz-BaseEventLoopTests.test_call_soon.<locals>.cb)	r>�	call_soonr*Z	_callback�assertIsInstancerPrWrZr[)r-rcr\r!r!r"�test_call_soon�s
z!BaseEventLoopTests.test_call_soonc	Cs4|j�d�|�td��|j�d�WdQRXdS)NTza callable objectr))r>�	set_debug�assertRaisesRegex�	TypeErrorrd)r-r!r!r"�test_call_soon_non_callable�sz.BaseEventLoopTests.test_call_soon_non_callablecCsHdd�}|j�d|�}|�|tj�|�||jj�|�||jj�dS)NcSsdS)Nr!r!r!r!r"rc�sz.BaseEventLoopTests.test_call_later.<locals>.cbg$@)	r>�
call_laterrerP�TimerHandlerZrYZassertNotInr[)r-rcr\r!r!r"�test_call_later�s
z"BaseEventLoopTests.test_call_latercs\g��fdd�}t��|j_|j�d|d�|j�d|d�t�|j�|��ddg�dS)Ncs��|�dS)N)�append)�arg)�callsr!r"rc�sz>BaseEventLoopTests.test_call_later_negative_delays.<locals>.cb����a����b)rr?r>rGrkr�run_brieflyr*)r-rcr!)rpr"�test_call_later_negative_delays�sz2BaseEventLoopTests.test_call_later_negative_delayscs~�fdd�}t���j_d}�j��|}�j�||��j��}�j���j��|}��||d|���|d|�dS)Ncs�j��dS)N)r>�stopr!)r-r!r"rc�sz4BaseEventLoopTests.test_time_and_call_at.<locals>.cbg�������?g�������?g�������?)	rr?r>rG�time�call_atrSZassertGreaterEqual�assertLessEqual)r-rc�delayZwhenZt0Zdtr!)r-r"�test_time_and_call_at�s

z(BaseEventLoopTests.test_time_and_call_atc	Cs�dd�}|�|�|r�d}|�t|��|�|�WdQRX|�t|��|�d|�WdQRX|�t|��|�|��d|�WdQRXn*|�|�|�d|�|�|��d|�dS)NcSsdS)Nr!r!r!r!r"rc
sz+BaseEventLoopTests.check_thread.<locals>.cbzMNon-thread-safe operation invoked on an event loop other than the current one�<)rgrhrRrdrkryrx)r-r>�debugrc�msgr!r!r"�check_threads
 
zBaseEventLoopTests.check_threadcsn�fdd��d�fdd�	}t���j_t���j_|�jd�|�jd�|�jddd�|�jddd�dS)	Nc
s�|��yN|rHt��}zt�|���||�Wdt�d�|��Xn��||�Wn0tk
r�}z|�|j	|�Wdd}~XYnX|�|j
d�dS)N)�waitrr=rPrBr�rN�	Exception�call_soon_threadsafeZ
set_exception�
set_result)r>�eventr~�create_loop�futZloop2�exc)r-r!r"�check_in_thread s

 z=BaseEventLoopTests.test_check_thread.<locals>.check_in_threadFcsZt��}tj|d�}|�|j�|||||f}tj�|d�}|��|�|�|�	�dS)N)r>)�target�args)
�	threadingZEventrPrQrd�setZThread�startrT�join)r>r~r�r�r�r�Zthread)r�r!r"�test_thread4s
z9BaseEventLoopTests.test_check_thread.<locals>.test_threadT)r�)F)rr?r>rGrH)r-r�r!)r�r-r"�test_check_threads
z$BaseEventLoopTests.test_check_threadcCs�t�t��ddd�d|jd�}t�t��ddd�d|jd�}|��t��|j_|jj	�
|�|jj	�
|�|j��|jjj
jdd}|�d|ko�d	kn|�|�|g|jj	�|�|jjj�dS)
Ng@cSsdS)NTr!r!r!r!r"rVOr2z3BaseEventLoopTests.test__run_once.<locals>.<lambda>r!g$@cSsdS)NTr!r!r!r!r"rVQr2rg#@g%@)rPrlrx�	monotonicr>r^rr?rGrYrn�	_run_oncer@rA�	call_argsrOr*�called)r-Zh1Zh2�tr!r!r"�test__run_onceNs


 z!BaseEventLoopTests.test__run_oncecCs<|j�d�|�|j���|j�d�|�|j���dS)NTF)r>rgrOZ	get_debugrM)r-r!r!r"�test_set_debug`sz!BaseEventLoopTests.test_set_debugzasyncio.base_events.loggercCs�dd�}|j�d�||jj_t��|j_|j��|�t	j
|jjdd�dd�}||jj_|j��|�t	j
|jjdd�dS)NcSst�d�gS)Ng�������?)rx�sleep)�timeoutr!r!r"�slow_selecths
z>BaseEventLoopTests.test__run_once_logging.<locals>.slow_selectTrcSst�d�gS)Ng����MbP?)rxr�)r�r!r!r"�fast_selectws
z>BaseEventLoopTests.test__run_once_logging.<locals>.fast_select)r>rgr@rArr?rGr�r*�logging�INFO�logr��DEBUG)r-�m_loggerr�r�r!r!r"�test__run_once_loggingfs



z)BaseEventLoopTests.test__run_once_loggingcs~d�d���fdd�}t�t��d||jf|jd�}t��|j_|jj�	|�|j�
�|���|��gt
|jj��dS)NFcsd�|�dd���dS)NTcSsdS)NTr!r!r!r!r"rV�r2zOBaseEventLoopTests.test__run_once_schedule_handle.<locals>.cb.<locals>.<lambda>)rd)r>)�handle�	processedr!r"rc�sz=BaseEventLoopTests.test__run_once_schedule_handle.<locals>.cbr))rPrlrxr�r>rr?rGrYrnr�rOr*�listr[)r-rcr\r!)r�r�r"�test__run_once_schedule_handles


z1BaseEventLoopTests.test__run_once_schedule_handlecCs�t��|j_|�dtjko$dkn�dd�}d}|j�d|�d}x&td�D]}|j�d|�}|�	�qTW|d7}x&td�D]}|j�d	|�}|�	�q�W|�
||tj�|�|jj
|�|j��|d8}|�|jj
|�|�t|jj�||�tt�tjtj��d}ttj|d�}||7}x t|�D]}|j�d|��q:W||7}x(t|�D]}|j�d|�}|�	��qdW|�t|jj�||�|j��|�t|jj�|�|�td
d�|jjD���dS)Nrg�?cSsdS)Nr!r!r!r!r"rc�szEBaseEventLoopTests.test__run_once_cancelled_event_cleanup.<locals>.cbr)i��i�dcSsg|]}|j�qSr!)Z
_cancelled)�.0�xr!r!r"�
<listcomp>�szMBaseEventLoopTests.test__run_once_cancelled_event_cleanup.<locals>.<listcomp>)rr?r>rGrOrZ%_MIN_CANCELLED_TIMER_HANDLES_FRACTIONrk�ranger^rzZ_MIN_SCHEDULED_TIMER_HANDLESr*Z_timer_cancelled_countr��lenrY�int�mathZceil�max�all)r-rcZnot_cancelled_countZcancelled_countr�r\Zadd_cancel_countZadd_not_cancel_countr!r!r"�&test__run_once_cancelled_event_cleanup�sN





z9BaseEventLoopTests.test__run_once_cancelled_event_cleanupcCs|�t|jjd�dS)NZblah)rDrir>rT)r-r!r!r"�"test_run_until_complete_type_error�sz5BaseEventLoopTests.test_run_until_complete_type_errorcCs6tj|jd�}|��}|�|j�|�t|j|�dS)N)r>)	rPrQr>Z
new_test_loop�
addCleanuprNrD�
ValueErrorrT)r-�taskZ
other_loopr!r!r"�test_run_until_complete_loop�s
z/BaseEventLoopTests.test_run_until_complete_loopcs~Gdd�dt���fdd�}�fdd�}t���j_�j�|�y�j�|d��Wn�k
rhYnX�j�|d��dS)	Nc@seZdZdS)z]BaseEventLoopTests.test_run_until_complete_loop_orphan_future_close_loop.<locals>.ShowStopperN)r7r8r9r!r!r!r"�ShowStopper�sr�c�stj|�jd�IdHdS)N)r>)rPr�r>)r{)r-r!r"�foo�szUBaseEventLoopTests.test_run_until_complete_loop_orphan_future_close_loop.<locals>.foocs��dS)Nr!r!)r�r!r"�throw�szWBaseEventLoopTests.test_run_until_complete_loop_orphan_future_close_loop.<locals>.throwg�������?g�������?)�
BaseExceptionrr?r>rGrdrT)r-r�r�r!)r�r-r"�5test_run_until_complete_loop_orphan_future_close_loop�szHBaseEventLoopTests.test_run_until_complete_loop_orphan_future_close_loopcCs�tjddg}|�t|jj|jjtj�|�t|jj|jjtj|�|�t|jj|jjtjtjd�|jt|jj|jjtjf|�ddi�|jt|jj|jjtjf|�ddi�|jt|jj|jjtjf|�ddi�dS)	Nz-c�pass�{�universal_newlinesT�shell�bufsizei)	�sys�
executablerDrir>rTZsubprocess_execrP�SubprocessProtocol)r-r�r!r!r"�!test_subprocess_exec_invalid_args�s&
z4BaseEventLoopTests.test_subprocess_exec_invalid_argsc	Cs�|�t|jj|jjtjd�|�t|jj|jjtjtjddg�|jt|jj|jjtjddd�|jt|jj|jjtjddd�|jt|jj|jjtjddd	�dS)
Nr�z-cr�zexit 0T)r�)r�i)r�)	rDrir>rTZsubprocess_shellrPr�r�r�)r-r!r!r"�"test_subprocess_shell_invalid_argss
z5BaseEventLoopTests.test_subprocess_shell_invalid_argsc	s�t���j_dd�}t�d��Z}tj�jd�}�j�||�|��fdd���j�	�|j
jt�
d�tttfd�WdQRXt�d��\}tj�jd�}�j�d	||�|��fd
d���j�	�|j
jt�
d�tttfd�WdQRXdS)NcSs|�d�dddS)NTr)r)r�)r�r!r!r"�
zero_error2s
zHBaseEventLoopTests.test_default_exc_handler_callback.<locals>.zero_errorzasyncio.base_events.logger)r>cs
�j��S)N)r>rw)r�)r-r!r"rV:r2zFBaseEventLoopTests.test_default_exc_handler_callback.<locals>.<lambda>zException in callback.*zero)�exc_infog{�G�z�?cs
�j��S)N)r>rw)r�)r-r!r"rVDr2)rr?r>rGr$rPrQrd�add_done_callbackrS�error�assert_called_withr�MockPattern�ZeroDivisionError�MOCK_ANYrk)r-r�r�r�r!)r-r"�!test_default_exc_handler_callback/s$

z4BaseEventLoopTests.test_default_exc_handler_callbackc	s�t���j_tj�fdd��}t�d��x}tj|��jd�}|��fdd���j�	�d}t
��tr�|j
jt�d�tttfd�n|j
jt�d	�d
d�WdQRXdS)Nc3s"tjd�jd�EdHdddS)Ng{�G�z�?)r>r)r)rPr�r>r!)r-r!r"�zero_error_coroMszIBaseEventLoopTests.test_default_exc_handler_coro.<locals>.zero_error_corozasyncio.base_events.logger)r>cs
�j��S)N)r>rw)r�)r-r!r"rVUr2zBBaseEventLoopTests.test_default_exc_handler_coro.<locals>.<lambda>z.*exception was never retrieved)r�z(.*exception was never retrieved.*ZeroDivF)rr?r>rGrP�	coroutiner$�
ensure_futurer�rSr�
gc_collect�PY34r�r�rr�r�r�)r-r�r�r�r!)r-r"�test_default_exc_handler_coroJs 
z0BaseEventLoopTests.test_default_exc_handler_coroc	Cs(|�td��|j�d�WdQRXdS)NzA callable object or None�spam)rhrir>�set_exception_handler)r-r!r!r"�test_set_exc_handler_invalidfsz/BaseEventLoopTests.test_set_exc_handler_invalidc	s�dd����fdd�}�j�d�t���j_���j���t��}�j�|����j��|�|�}|�	�jt
t�d�||j
d��|���j�d�t�d��(}|�|jj	t�d	�tt
t
fd
�WdQRX|jr�t�dS)NcSsdddS)Nr)rr!r!r!r!r"r�kszBBaseEventLoopTests.test_set_exc_handler_custom.<locals>.zero_errorcs�j���}�j��|S)N)r>rdr�)r�)r-r�r!r"�run_loopns
z@BaseEventLoopTests.test_set_exc_handler_custom.<locals>.run_loopTz!Exception in callback.*zero_error)�	exception�messager�Zsource_tracebackzasyncio.base_events.loggerzException in callback.*zero)r�)r>rgrr?rGr,Zget_exception_handlerr�r`r�r�rr�Z_source_traceback�
reset_mockr$r�r�r��AssertionError)r-r�Zmock_handlerr�r�r!)r-r�r"�test_set_exc_handler_customjs0z.BaseEventLoopTests.test_set_exc_handler_customc	sh�fdd�}dd�}t���j_�j�|�t�d��(}|�|jjt�	d�t
ttfd�WdQRXdS)Ncs"dd�}�j�|��j��dS)NcSsdddS)Nr)rr!r!r!r!r"r��szTBaseEventLoopTests.test_set_exc_handler_broken.<locals>.run_loop.<locals>.zero_error)r>rdr�)r�)r-r!r"r��sz@BaseEventLoopTests.test_set_exc_handler_broken.<locals>.run_loopcSstd��dS)Nr�)�AttributeError)r>�contextr!r!r"�handler�sz?BaseEventLoopTests.test_set_exc_handler_broken.<locals>.handlerzasyncio.base_events.loggerz$Unhandled error in exception handler)r�)rr?r>rGr�r$r�r�rr�r�r�)r-r�r�r�r!)r-r"�test_set_exc_handler_broken�sz.BaseEventLoopTests.test_set_exc_handler_brokenc	s�d�G�fdd�dtj�}|��|��j�t����fdd�}t�d��}|�|jj	ddd�WdQRXd	d
�}d���
|�t�d��F}|�|jj	t�d�dd�|�
d��|�t�dd
�t�WdQRXdS)Ncs(eZdZe��Ze��Z�fdd�ZdS)z@BaseEventLoopTests.test_default_exc_handler_broken.<locals>.Loopcs|�td��dS)Nr�)r�)r-r�)�_contextr!r"�default_exception_handler�szZBaseEventLoopTests.test_default_exc_handler_broken.<locals>.Loop.default_exception_handlerN)r7r8r9rr?r@rGr�r!)r�r!r"�Loop�sr�csdd�}��|����dS)NcSsdddS)Nr)rr!r!r!r!r"r��szXBaseEventLoopTests.test_default_exc_handler_broken.<locals>.run_loop.<locals>.zero_error)rdr�)r�)r>r!r"r��s
zDBaseEventLoopTests.test_default_exc_handler_broken.<locals>.run_loopzasyncio.base_events.loggerz&Exception in default exception handlerT)r�cSstd��dS)NZham)r�)r>r�r!r!r"�custom_handler�szJBaseEventLoopTests.test_default_exc_handler_broken.<locals>.custom_handlerz9Exception in default exception.*while handling.*in customr�r�)rr=r�rNrPrBrr$r�r�r�rr�rZr`�typer�)r-r�r�r�r�r!)r�r>r"�test_default_exc_handler_broken�s,

z2BaseEventLoopTests.test_default_exc_handler_brokenc	Cs8|�td��|j�d�WdQRX|�|j���dS)Nz'task factory must be a callable or Noner))rhrir>�set_task_factoryr,�get_task_factory)r-r!r!r"�test_set_task_factory_invalid�s
z0BaseEventLoopTests.test_set_task_factory_invalidcs�t��|j_Gdd�dtj��tjdd��}�fdd�}|�|j���|j�	|�|�
|j��|�|j�|��}|�t
|���|j�|�|j�	d�|�|j���|j�|��}|�t
|tj��|�t
|���|j�|�dS)Nc@seZdZdS)z8BaseEventLoopTests.test_set_task_factory.<locals>.MyTaskN)r7r8r9r!r!r!r"�MyTask�sr�cSsdS)Nr!r!r!r!r"�coro�sz6BaseEventLoopTests.test_set_task_factory.<locals>.corocs�||d�S)N)r>r!)r>r�)r�r!r"rV�r2z:BaseEventLoopTests.test_set_task_factory.<locals>.<lambda>)rr?r>rGrP�Taskr�r,r�r�r`�create_taskrO�
isinstancerTrM)r-r��factoryr�r!)r�r"�test_set_task_factory�s z(BaseEventLoopTests.test_set_task_factorycCs�d�d�}tdd|�\}}}|�|��d�td|ddd�\}}}|�|��d�td|ddd�\}}}|�|��d	�tdd|dd
�\}}}|�|��d�tdddd|�\}}}|�|��d	�dS)
N�
)zimport asynciozloop = asyncio.get_event_loop()zprint(loop.get_debug())z-Ez-csFalser()�PYTHONASYNCIODEBUGZ
PYTHONDEVMODEr3sTrue)r�z-XZdev)r�rr*�rstrip)r-�code�sts�stdout�stderrr!r!r"�test_env_var_debug�s$z%BaseEventLoopTests.test_env_var_debugcszGdd�dtj��tjdd��}G��fdd�dtj�}|��|���|�}tj|�d�}|�|��d|_|�	�dS)	Nc@seZdZdS)z3BaseEventLoopTests.test_create_task.<locals>.MyTaskN)r7r8r9r!r!r!r"r�sr�cSsdS)Nr!r!r!r!r"�testsz1BaseEventLoopTests.test_create_task.<locals>.testcseZdZ��fdd�ZdS)z6BaseEventLoopTests.test_create_task.<locals>.EventLoopcs�|�d�S)N)r>r!)r-r�)r�r>r!r"r�szBBaseEventLoopTests.test_create_task.<locals>.EventLoop.create_taskN)r7r8r9r�r!)r�r>r!r"�	EventLoopsr�)r>F)
rPr�r�rr=rBr�reZ_log_destroy_pendingrN)r-r�r�r�r�r!)r�r>r"�test_create_tasks
z#BaseEventLoopTests.test_create_taskcCsttjdd��}t��|j_t��|j_y|j�|��Wntk
rLYnX|j�	�t
��|�|jjj
�dS)NcSst�dS)N)�KeyboardInterruptr!r!r!r"�raise_keyboard_interrupt0szXBaseEventLoopTests.test_run_forever_keyboard_interrupt.<locals>.raise_keyboard_interrupt)rPr�rr?r>rGZcall_exception_handlerrTr�rNrr�rMr�)r-r�r!r!r"�#test_run_forever_keyboard_interrupt,s
z6BaseEventLoopTests.test_run_forever_keyboard_interruptcs�tjdd��}t���j_y�j�|��Wntk
r@YnX��fdd��d�_y�j�	���j�
�Wntk
r�YnX���j�dS)NcSst�dS)N)r�r!r!r!r"r�CszZBaseEventLoopTests.test_run_until_complete_baseexception.<locals>.raise_keyboard_interruptcs�j��d�_dS)NT)r>rwr�r!)�funcr-r!r"rNs
zFBaseEventLoopTests.test_run_until_complete_baseexception.<locals>.funcF)rPr�rr?r>rGrTr�r�rdrSrO)r-r�r!)rr-r"�%test_run_until_complete_baseexception@sz8BaseEventLoopTests.test_run_until_complete_baseexceptionc
s�t��d�d�����fdd�}���fdd����fdd��|�j_�f�jjj_xRtdd	�D]D}��d
|��,�j��jj	��j�
����d�WdQRXq`WdS)Nrcs�|kr�j����dS)N)r>rd)Z
event_list)�do_event�doer�event_sentinelr-r!r"�proc_events`szZBaseEventLoopTests.test_single_selecter_event_callback_after_stopping.<locals>.proc_eventscs�d7��j���dS)Nr))r>rdr!)�	callcount�clear_selectorr-r!r"reszWBaseEventLoopTests.test_single_selecter_event_callback_after_stopping.<locals>.do_eventcs���d�jjj_dS)Nr!)r^r>r@rArr!)rr-r!r"rjsz]BaseEventLoopTests.test_single_selecter_event_callback_after_stopping.<locals>.clear_selectorr)r	z	Loop %d/2)�objectr>rGr@rArr�ZsubTestrdrwrSr*)r-r�ir!)rrrrrr-r"�2test_single_selecter_event_callback_after_stoppingYs
zEBaseEventLoopTests.test_single_selecter_event_callback_after_stoppingcsDd��fdd�}t��|j_|j�|�t�|j�|��d�dS)Nrcs�d7�dS)Nr)r!r!)�countr!r"�callback~sz2BaseEventLoopTests.test_run_once.<locals>.callbackr))rr?r>rGrdrZrun_oncer*)r-r
r!)rr"�
test_run_oncewsz BaseEventLoopTests.test_run_oncecCs4t��|j_|j��|j��|jjj�d�dS)Nr)	rr?r>rGrwrSr@rAZassert_called_once_with)r-r!r!r"�test_run_forever_pre_stopped�s

z/BaseEventLoopTests.test_run_forever_pre_stoppedc�sFdddd���fdd�}|�}|������fdd��t�����S)NF)�started�stopped�	finalizedc	s0d�d<zxdD]
}|VqWWdd�d<XdS)NTr)ZZEROZONEZTWO�THREEZFOURrr!)�item)�statusr!r"�agen�s

z;BaseEventLoopTests.leave_unfinalized_asyncgen.<locals>.agenc�sLy���IdH}Wntk
r&dSX|dkr<d�d<dSt����dS)NrTr)�	__anext__�StopAsyncIterationrPr�)r)�ai�iter_onerr!r"r�sz?BaseEventLoopTests.leave_unfinalized_asyncgen.<locals>.iter_one)�	__aiter__rPr�)r-rZagr!)rrrr"�leave_unfinalized_asyncgen�s
z-BaseEventLoopTests.leave_unfinalized_asyncgenc	Cs�t��|j_t��|j_t���||j�|���}x|dsJt	�
|j�q4W|�|d�|�|d�|�|d�t�
�t	�
|j�|�|d�WdQRXdS)Nrrr)rr?r>rGrHr�
disable_gcrTrrrurOrMr�)r-rr!r!r"� test_asyncgen_finalization_by_gc�s

z3BaseEventLoopTests.test_asyncgen_finalization_by_gcc	Cs�t��|j_t��|j_|j�d�t����|j�|�	��}x|dsVt
�|j�q@W|�|d�|�|d�|�
|d�|j�|j�dtj��t
�|j�|�|d�WdQRXdS)NTrrr)rr?r>rGrHrgrrrTrrrurOrM�run_in_executorr�)r-rr!r!r"�0test_asyncgen_finalization_by_gc_in_other_thread�s

zCBaseEventLoopTests.test_asyncgen_finalization_by_gc_in_other_thread)/r7r8r9r<rLrUr]r_rbrfrjrmrvr|r�r�r�r�rr$r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrr �
__classcell__r!r!)rCr"r:�sR		/L$0"r:c@s:eZdZdZd
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)�MyProtoNFcCsd|_d|_|rt��|_dS)N�INITIALr)�state�nbytesrPrQ�done)r-�
create_futurer!r!r"�__init__�szMyProto.__init__cCs.||_|jdkst|j��d|_|�d�dS)Nr#�	CONNECTEDs%GET / HTTP/1.0
Host: example.com

)�	transportr$r��write)r-r*r!r!r"�connection_made�szMyProto.connection_madecCs*|jdkst|j��|jt|�7_dS)Nr))r$r�r%r�)r-�datar!r!r"�
data_received�szMyProto.data_receivedcCs|jdkst|j��d|_dS)Nr)�EOF)r$r�)r-r!r!r"�eof_received�szMyProto.eof_receivedcCs0|jdkst|j��d|_|jr,|j�d�dS)N)r)r/�CLOSED)r$r�r&r�)r-r�r!r!r"�connection_lost�szMyProto.connection_lost)F)	r7r8r9r&r(r,r.r0r2r!r!r!r"r"�s
r"c@s:eZdZdZd
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)�MyDatagramProtoNFcCs"d|_d|_|rtj|d�|_dS)Nr#r)r>)r$r%rPrQr&)r-r'r>r!r!r"r(�szMyDatagramProto.__init__cCs$||_|jdkst|j��d|_dS)Nr#�INITIALIZED)r*r$r�)r-r*r!r!r"r,�szMyDatagramProto.connection_madecCs*|jdkst|j��|jt|�7_dS)Nr4)r$r�r%r�)r-r-�addrr!r!r"�datagram_received�sz!MyDatagramProto.datagram_receivedcCs|jdkst|j��dS)Nr4)r$r�)r-r�r!r!r"�error_receivedszMyDatagramProto.error_receivedcCs0|jdkst|j��d|_|jr,|j�d�dS)Nr4r1)r$r�r&r�)r-r�r!r!r"r2szMyDatagramProto.connection_lost)FN)	r7r8r9r&r(r,r6r7r2r!r!r!r"r3�s
r3csreZdZ�fdd�Ze�d�dd��Zedd��Zedd	��Z	d
d�Z
dd
�Zdd�Zdd�Z
e�eed�d�dd��Ze�eed�d�dd��Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zed$d%��Zd&d'�Zed(d)��Zed*d+��Zed,d-��Zed.d/��Zd0d1�Zed2d3��Z d4d5�Z!d6d7�Z"d8d9�Z#d:d;�Z$d<d=�Z%d>d?�Z&d@dA�Z'dBdC�Z(edDdE��Z)edFdG��Z*edHdI��Z+edJdK��Z,dLdM�Z-dNdO�Z.dPdQ�Z/edRdS��Z0e�e1j2dT�dUdV��Z3edWdX��Z4dYdZ�Z5ed[d\��Z6d]d^�Z7e�eed_�d`�dadb��Z8dcdd�Z9dedf�Z:dgdh�Z;didj�Z<edkdl��Z=edmdn��Z>dodp�Z?e�dq�drds��Z@dtdu�ZAe�dq�dvdw��ZB�ZCS)x�BaseEventLoopWithSelectorTestscs$t���t��|_|�|j�dS)N)r;r<rP�new_event_loopr>rB)r-)rCr!r"r<s

z$BaseEventLoopWithSelectorTests.setUpzsocket.getnameinfocCs.dd�|_|j�|j�d��}|�|d�dS)NcWsdS)N�*r!)r�r!r!r"rVr2zABaseEventLoopWithSelectorTests.test_getnameinfo.<locals>.<lambda>)�abcr�r:)�side_effectr>rTZgetnameinfor*)r-Zm_gai�rr!r!r"�test_getnameinfos
z/BaseEventLoopWithSelectorTests.test_getnameinfoc	s�Gdd�dtj�}tjdd�����fdd�}d�dd	g���fd
d�}||_|�j_�j�|dd
�}��t��}�j�	|�WdQRX��
t|j�d�dS)Nc@seZdZdS)zVBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors.<locals>.MyProtoN)r7r8r9r!r!r!r"r"sr"csgEdHddgS)N)r�r)�r()z107.6.106.82�Pr!)r��kwr!r!r"r s
zZBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors.<locals>.getaddrinfocstj�||��jd�S)N)r>)rPr�r>)r��kwds)rr-r!r"�getaddrinfo_task&sz_BaseEventLoopWithSelectorTests.test_create_connection_multiple_errors.<locals>.getaddrinfo_taskrqZerr1Zerr2cs�d7�t����dS)Nr))�OSError)r�rA)�errors�idxr!r"�_socket,szVBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors.<locals>._socketzexample.comr@zMultiple exceptions: err1, err2)
rP�Protocolr�rr>r�create_connectionrDrDrTr*�strr�)r-rr"rCrGr��cmr!)rErrFr-r"�&test_create_connection_multiple_errorsszEBaseEventLoopWithSelectorTests.test_create_connection_multiple_errorsc
s�t��}||j_�fdd�}|�j_tjj�jdtj	d��H�j�
tdd�}��tj	���j�
|�WdQRX��|jj�WdQRXdS)Ncs0tj�jd�}tjtjdddf}|�|g�|S)N)r>rr()z	127.0.0.1r@)rPrQr>rrrr�)r�rAr�r5)r-r!r"rAs
zRBaseEventLoopWithSelectorTests.test_create_connection_timeout.<locals>.getaddrinfo�sock_connect)r<z	127.0.0.1r@)rr?rrr>rr$r	rP�TimeoutErrorrIr"rDrTrOrNr�)r-r�sockrr�r!)r-r"�test_create_connection_timeout;sz=BaseEventLoopWithSelectorTests.test_create_connection_timeoutcCs,|jjtddt�d�}|�t|jj|�dS)Nzexample.comr@)rO)r>rIr"r	rDr�rT)r-r�r!r!r"�%test_create_connection_host_port_sockPszDBaseEventLoopWithSelectorTests.test_create_connection_host_port_sockc
CsXt�tjtj�}|�:|jjt|d�}|�td��|j�|�WdQRXWdQRXdS)N)rOzA Stream Socket was expected)	rrrr>rIr"rhr�rT)r-rOr�r!r!r"�!test_create_connection_wrong_sockUsz@BaseEventLoopWithSelectorTests.test_create_connection_wrong_sockc
CsXt�tjtj�}|�:|jjt|d�}|�td��|j�|�WdQRXWdQRXdS)N)rOzA Stream Socket was expected)	rrrr>�
create_serverr"rhr�rT)r-rOr�r!r!r"�test_create_server_wrong_sock]sz<BaseEventLoopWithSelectorTests.test_create_server_wrong_sockc	Cs<|jjtdddd�}|�td��|j�|�WdQRXdS)Nzexample.comr@r))�ssl_handshake_timeoutz1ssl_handshake_timeout is only meaningful with ssl)r>rSr"rhr�rT)r-r�r!r!r"�/test_create_server_ssl_timeout_for_plain_socketeszNBaseEventLoopWithSelectorTests.test_create_server_ssl_timeout_for_plain_socket�
SOCK_NONBLOCKz$no socket.SOCK_NONBLOCK (linux only)c	Csbt�tjtjtjB�}|�>|jjdd�|d�}|j�|�}|��|j�|���WdQRXdS)NcSsdS)Nr!r!r!r!r"rVsr2zRBaseEventLoopWithSelectorTests.test_create_server_stream_bittype.<locals>.<lambda>)rO)	rrrrWr>rSrTrN�wait_closed)r-rOr��srvr!r!r"�!test_create_server_stream_bittypemsz@BaseEventLoopWithSelectorTests.test_create_server_stream_bittyper
zno IPv6 supportc
sj�fdd�}y�j�|��WnFtk
rd}z(ttd�rR|jtjkrR��d�n�Wdd}~XYnXdS)Nc�sRtjdd�dd�jd�IdH}z��t|j�d�Wd|��|��IdHXdS)NcSsdS)Nr!r!r!r!r"rV|r2zVBaseEventLoopWithSelectorTests.test_create_server_ipv6.<locals>.main.<locals>.<lambda>z::1r)r>)rPZstart_serverr>Z
assertGreaterr��socketsrNrX)rY)r-r!r"�mainzszDBaseEventLoopWithSelectorTests.test_create_server_ipv6.<locals>.main�
EADDRNOTAVAILzfailed to bind to ::1)r>rTrDr�errnor]ZskipTest)r-r\Zexr!)r-r"�test_create_server_ipv6xs	
z6BaseEventLoopWithSelectorTests.test_create_server_ipv6c
CsTt�tj�}|�:|jjt|d�}|�td��|j�|�WdQRXWdQRXdS)N)rOzA UDP Socket was expected)rrr>�create_datagram_endpointr"rhr�rT)r-rOr�r!r!r"�(test_create_datagram_endpoint_wrong_sock�szGBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_wrong_sockcCs"|j�t�}|�t|jj|�dS)N)r>rIr"rDr�rT)r-r�r!r!r"�(test_create_connection_no_host_port_sock�szGBaseEventLoopWithSelectorTests.test_create_connection_no_host_port_sockcsJtjdd�����fdd�}|�j_�j�tdd�}��t�jj|�dS)NcsgEdHdS)Nr!)r�rAr!r!r"r�szYBaseEventLoopWithSelectorTests.test_create_connection_no_getaddrinfo.<locals>.getaddrinfocstj�||��jd�S)N)r>)rPr�r>)r�rB)rr-r!r"rC�sz^BaseEventLoopWithSelectorTests.test_create_connection_no_getaddrinfo.<locals>.getaddrinfo_taskzexample.comr@)	rPr�r>rrIr"rDrDrT)r-rCr�r!)rr-r"�%test_create_connection_no_getaddrinfo�szDBaseEventLoopWithSelectorTests.test_create_connection_no_getaddrinfocsZdd����fdd�}|�j_t���j_t�jj_�j�tdd�}��	t�jj
|�dS)Nc�sdgS)N)r�r)r?r()z107.6.106.82r@r!)r�rAr!r!r"r�szVBaseEventLoopWithSelectorTests.test_create_connection_connect_err.<locals>.getaddrinfocstj�||��jd�S)N)r>)rPr�r>)r�rB)rr-r!r"rC�sz[BaseEventLoopWithSelectorTests.test_create_connection_connect_err.<locals>.getaddrinfo_taskzexample.comr@)r>rrr?rMrDr<rIr"rDrT)r-rCr�r!)rr-r"�"test_create_connection_connect_err�s
zABaseEventLoopWithSelectorTests.test_create_connection_connect_errc	svtjdd�����fdd�}|�j_t���j_t�jj_�jj	t
ddtjd�}��
t���j�|�WdQRXdS)Nc_sddgS)N)r�r)r?r()z0.0.0.1r@)r�r)r?r()z0.0.0.2r@r!)r�rAr!r!r"r�szSBaseEventLoopWithSelectorTests.test_create_connection_multiple.<locals>.getaddrinfocstj�||��jd�S)N)r>)rPr�r>)r�rB)rr-r!r"rC�szXBaseEventLoopWithSelectorTests.test_create_connection_multiple.<locals>.getaddrinfo_taskzexample.comr@)�family)rPr�r>rrr?rMrDr<rIr"rrrDrT)r-rCr�r!)rr-r"�test_create_connection_multiple�s
z>BaseEventLoopWithSelectorTests.test_create_connection_multiplec	s�dd�}||jj_tjdd�����fdd�}|�j_t���j_	t
d��jj	_�jjt
dd	tjd
d�}��t
��}�j�|�WdQRX��t|j��d����|jjjj�dS)
NcSs"|ddkrtd�}d|_|�dS)Nrz0.0.0.1�Err)rD�strerror)r5�errr!r!r"�bind�sz^BaseEventLoopWithSelectorTests.test_create_connection_multiple_errors_local_addr.<locals>.bindc_sddgS)N)r�r)r?r()z0.0.0.1r@)r�r)r?r()z0.0.0.2r@r!)r�rAr!r!r"r�szeBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors_local_addr.<locals>.getaddrinfocstj�||��jd�S)N)r>)rPr�r>)r�rB)rr-r!r"rC�szjBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors_local_addr.<locals>.getaddrinfo_taskZErr2zexample.comr@)Ni�)re�
local_addrzMultiple exceptions: )rrrjrPr�r>rrr?rMrDr<rIr"rrDrTrOrJr��
startswithrNr�)r-rrjrCr�rKr!)rr-r"�1test_create_connection_multiple_errors_local_addr�s

zPBaseEventLoopWithSelectorTests.test_create_connection_multiple_errors_local_addrc	Csn|s|`tj|_|jj}t��|j_d|jj_t��|j_	d|jj	_|j�
tjdd�}|j�
|�\}}z@|j�d�|jj\}}|�|d|j�|�|d|j�Wd|��t�|j�Xtj|_|j�
tjdd�}|j�
|�\}}zj|jjd\}	|	dd	�\}
}|�|
d
�|�|d�|jj\}}|�|d|j�|�|d|j�Wd|��t�|j�XdS)NFz1.2.3.4r@)z1.2.3.4r@rer�z::1rr�z	::(0\.)*1)rrrrrr?r>�_add_readerr�_add_writerrIrPrHrT�connectr�r�r*rrrNrrur
re�assertRegex)r-rZallow_inet_ptonrOr�r��p�_�kwargsZaddress�host�portr!r!r"�_test_create_connection_ip_addr�s<

z>BaseEventLoopWithSelectorTests._test_create_connection_ip_addrc	Cs�tj|_|jj}tj|_t��|j_d|jj_	t��|j_
d|jj
_	|j�tj
dd�}|j�|�\}}z@|j�d�|jj\}}|�|d|j�|�|d|j�Wd|��t�|j�XdS)NFz	fe80::1%1r@)zfe80::1r@rr)rer�)rrrr
rerr?r>rnrrorIrPrHrTrpr�r�r*rrNrru)r-rrOr�r�rrrsrtr!r!r"�!test_create_connection_ipv6_scopes 

z@BaseEventLoopWithSelectorTests.test_create_connection_ipv6_scopecCs|�|d�dS)NT)rw)r-rr!r!r"�test_create_connection_ip_addr%sz=BaseEventLoopWithSelectorTests.test_create_connection_ip_addrcCs|�|d�dS)NF)rw)r-rr!r!r"�#test_create_connection_no_inet_pton)szBBaseEventLoopWithSelectorTests.test_create_connection_no_inet_ptonc

Cstj|_|jj}t��|j_d|jj_t��|j_d|jj_x�dD]�\}}|j�	t
jd|�}|j�|�\}}zD|j
�d|f�|jj\}}	|�|	d|j�|�|	d|j�Wd|��t�|j�XqBWx@dD]8}|j�	t
jd|�}|�t��|j�|�WdQRXq�WdS)NF))Zhttpr@)shttpr@z	127.0.0.1rer�)Znonsensesnonsense)rrrrr?r>rnrrorIrPrHrTrpr�r�r*rrrNrrurDrD)
r-rrOZservicervr�r�rrrsrtr!r!r"�#test_create_connection_service_name-s,




zBBaseEventLoopWithSelectorTests.test_create_connection_service_namecsRtjdd�����fdd�}|�j_�jjtddtjdd�}��t	�jj
|�dS)	Nc_s|dkrddgSgSdS)Nzexample.com)r�r)r?r()z107.6.106.82r@r!)rur�rAr!r!r"rMszXBaseEventLoopWithSelectorTests.test_create_connection_no_local_addr.<locals>.getaddrinfocstj�||��jd�S)N)r>)rPr�r>)r�rB)rr-r!r"rCUsz]BaseEventLoopWithSelectorTests.test_create_connection_no_local_addr.<locals>.getaddrinfo_taskzexample.comr@)Ni�)rerk)rPr�r>rrIr"rrrDrDrT)r-rCr�r!)rr-r"�$test_create_connection_no_local_addrLs
zCBaseEventLoopWithSelectorTests.test_create_connection_no_local_addrcs<d��fdd�}||_|��}|j�|��}|j�|�dS)N)z00:01:02:03:04:05r)cs$||f�kst�dddd�dffgS)Ni�r)r()r�)rurvr�rA)r5r!r"reszTBaseEventLoopWithSelectorTests.test_create_connection_bluetooth.<locals>.getaddrinfo)rrr>rMrT)r-rrrOr�r!)r5r"� test_create_connection_bluetooth_sz?BaseEventLoopWithSelectorTests.test_create_connection_bluetoothc	s�t���j_�fdd�}|�jj_t���j_�j���jj_�jjj�d�t���j_	Gdd�d���fdd�}|�jj	_tj
}t�}�jj	���jj
tddd	|d
�}�j�|�\}}|���jj	j||||dd|d��jj	���jj
tddd	d
|d�}�j�|�\}}|���jj	j||||dd
|d��jj	���jj
tddd	d|d�}�j�|�\}}|���jj	j||||dd|d�dS)Ncs.tj�jd�}|�tjtjtjddfg�|S)N)r>r()z1.2.3.4r@)rPrQr>r�rrrZSOL_TCP)r�rBr%)r-r!r"�mock_getaddrinfoqszkBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_default.<locals>.mock_getaddrinfoc@s eZdZdZdd�Zdd�ZdS)zqBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_default.<locals>._SelectorTransportMockNcSst��S)N)rr?)r-�keyr!r!r"�get_extra_info�sz�BaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_default.<locals>._SelectorTransportMock.get_extra_infocSs|j��dS)N)�_sockrN)r-r!r!r"rN�szwBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_default.<locals>._SelectorTransportMock.close)r7r8r9r�r�rNr!r!r!r"�_SelectorTransportMock}sr�cs|�d���}||_|S)N)r�r�)rO�protocolZ
sslcontextZwaiterrBr*)r�r!r"�mock_make_ssl_transport�s
zrBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_default.<locals>.mock_make_ssl_transportz
python.orgr@T)�sslrUF)Zserver_side�server_hostnamerUzperl.com)r�r�rUr()rr?r>rr<rMr'rr�rF�ANYr	r�rIr"rTrNr�)r-r~r�r�Zhandshake_timeoutr�r*rsr!)r�r-r"�2test_create_connection_ssl_server_hostname_defaultns^
	
zQBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_defaultcCsP|jjtdddd�}|�t|jj|�|jjtdddd�}|�t|jj|�dS)Nz
python.orgr@r()r�)r>rIr"rDr�rT)r-r�r!r!r"�4test_create_connection_no_ssl_server_hostname_errors�szSBaseEventLoopWithSelectorTests.test_create_connection_no_ssl_server_hostname_errorscCs�|jjtdddd�}|�t|jj|�|jjtdddd�}|�t|jj|�t��}|jjtddd|d�}|�|j�|�t|jj|�dS)Nr(r@T)r�)r�rO)	r>rIr"rDr�rTrr�rN)r-r�rOr!r!r"�1test_create_connection_ssl_server_hostname_errors�s
zPBaseEventLoopWithSelectorTests.test_create_connection_ssl_server_hostname_errorsc	Cs<|jjtdddd�}|�td��|j�|�WdQRXdS)Nzexample.comr@r))rUz1ssl_handshake_timeout is only meaningful with ssl)r>rIr"rhr�rT)r-r�r!r!r"�3test_create_connection_ssl_timeout_for_plain_socket�szRBaseEventLoopWithSelectorTests.test_create_connection_ssl_timeout_for_plain_socketcs^t��tj�fdd�����fdd�}|�j_�j�tdd�}��t�jj	|���
��dS)Nc?s|d�gEdHdS)Nrr!)r�rA)rur!r"r�szQBaseEventLoopWithSelectorTests.test_create_server_empty_host.<locals>.getaddrinfocstj�||��jd�S)N)r>)rPr�r>)r�rB)rr-r!r"rC�szVBaseEventLoopWithSelectorTests.test_create_server_empty_host.<locals>.getaddrinfo_taskr(r)r	rPr�r>rrSr"rDrDrTr,)r-rCr�r!)rrur-r"�test_create_server_empty_host�sz<BaseEventLoopWithSelectorTests.test_create_server_empty_hostcCs,|jjtddt�d�}|�t|jj|�dS)Nz0.0.0.0r)rO)r>rSr"r	rDr�rT)r-r�r!r!r"�!test_create_server_host_port_sock�sz@BaseEventLoopWithSelectorTests.test_create_server_host_port_sockcCs"|j�t�}|�t|jj|�dS)N)r>rSr"rDr�rT)r-r�r!r!r"�$test_create_server_no_host_port_sock�szCBaseEventLoopWithSelectorTests.test_create_server_no_host_port_sockcCsNt��}|j_|j��|_|j�d�|j�tdd�}|�	t
|jj|�dS)Nz
python.orgr)rr?r>rr'rr�rSr"rDrDrT)r-rr%r!r!r"�!test_create_server_no_getaddrinfo�s
z@BaseEventLoopWithSelectorTests.test_create_server_no_getaddrinfocCsBtj|_|`t��|j_|jjtdddd�}|�	t
|jj|�dS)Nz0.0.0.0rT)�
reuse_port)rr�SO_REUSEPORTrr?rr>rSr"rDr�rT)r-rr%r!r!r"� test_create_server_nosoreuseport�sz?BaseEventLoopWithSelectorTests.test_create_server_nosoreuseportcCsDtj|_t��|j_d|_|jjtdddd�}|�	t
|jj|�dS)Nrqz0.0.0.0rT)r�)rrrr?rr�r>rSr"rDr�rT)r-rr%r!r!r"�+test_create_server_soreuseport_only_definedszJBaseEventLoopWithSelectorTests.test_create_server_soreuseport_only_definedcCsnGdd�dt�}dg|j_d|j_t��}|j_||j_|j	�
tdd�}|�t|j	j
|�|�|jj�dS)Nc@seZdZdZdS)zHBaseEventLoopWithSelectorTests.test_create_server_cant_bind.<locals>.Errr�N)r7r8r9rhr!r!r!r"rgsrg)r�r)r?r()z	127.0.0.1it'Fz0.0.0.0r)rDrrrrr?rrjr<r>rSr"rDrTrOrNr�)r-rrg�m_sockr�r!r!r"�test_create_server_cant_bind
s
z;BaseEventLoopWithSelectorTests.test_create_server_cant_bindcCs6g|j_d|j_|jjtdd�}|�t|jj|�dS)NF)�	localhostr)rk)	rrrr>r`r3rDrDrT)r-rr�r!r!r"�)test_create_datagram_endpoint_no_addrinfos
zHBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_no_addrinfocCsH|jjtdd�}|�t|jj|�|jjtdd�}|�t|jj|�dS)Nr�)rk)r�r)r�r	)r>r`r3rDr�rT)r-r�r!r!r"�(test_create_datagram_endpoint_addr_error's

zGBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_addr_errorcCs>t��|j_t|jj_|jjtjdd�}|�	t|jj
|�dS)N)z	127.0.0.1r)�remote_addr)rr?r>rMrDr<r`rP�DatagramProtocolrDrT)r-r�r!r!r"�)test_create_datagram_endpoint_connect_err1s
zHBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_connect_errcs�td|jd��t��|j_}g|_|jj�fdd�ddd�}|j�|�\}}|�|j	�|�
�|j��j�|�d�j
�dS)NT)r'r>cs�S)Nr!r!)r�r!r"rV@r2z^BaseEventLoopWithSelectorTests.test_create_datagram_endpoint_allow_broadcast.<locals>.<lambda>)z	127.0.0.1r)r��allow_broadcastr1)r3r>rr?rMrr`rTrMr�rNr&r*r$)r-rMr�r*rsr!)r�r"�-test_create_datagram_endpoint_allow_broadcast:s
zLBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_allow_broadcastcCs^tj|_t|j_|jjtjtjd�}|�	t|jj
|�|jjtjdd�}|�	t|jj
|�dS)N)re)z	127.0.0.1r)rk)rrrDr<r>r`rPr�rrDrT)r-rr�r!r!r"�(test_create_datagram_endpoint_socket_errKszGBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_socket_errzIPv6 not supported or enabledcCs*|jjtjddd�}|�t|jj|�dS)N)z	127.0.0.1r)z::1r)r�rk)r>r`rPr�rDr�rT)r-r�r!r!r"�0test_create_datagram_endpoint_no_matching_familyZs

zOBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_no_matching_familycCsHt|jjj_|jjtjtj	d�}|�
t|jj|�|�|jjj
j�dS)N)re)rDrr�setblockingr<r>r`rPr�rrDrTrOrNr�)r-rr�r!r!r"�(test_create_datagram_endpoint_setblk_errbszGBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_setblk_errcCs$|j�tj�}|�t|jj|�dS)N)r>r`rPr�rDr�rT)r-r�r!r!r"�-test_create_datagram_endpoint_noaddr_nofamilymszLBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_noaddr_nofamilycCshGdd�dt�}tj|_t��}|j_||j_|jj	t
dtjd�}|�||jj
|�|�|jj�dS)Nc@seZdZdS)zSBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_cant_bind.<locals>.ErrN)r7r8r9r!r!r!r"rgtsrg)z	127.0.0.1r)rkre)rDrrrr?rrjr<r>r`r3rrDrTrOrNr�)r-rrgr�r�r!r!r"�'test_create_datagram_endpoint_cant_bindrszFBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_cant_bindcsjt�tjtj�}|�d��jj�fdd�|d�}�j�|�\}}|���j�|j���	d|j
�dS)N)z	127.0.0.1rcstd�jd�S)NT)r'r>)r3r>r!)r-r!r"rV�r2zSBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock.<locals>.<lambda>)rOr1)rrrrjr>r`rTrNr&r*r$)r-rOr�r*r�r!)r-r"�"test_create_datagram_endpoint_sock�s

zABaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock�AF_UNIXzNo UNIX Socketscsd�jj�fdd�tjd�}�j�|�\}}|jjtjks<t�|���j�|j	���
d|j�dS)Ncstd�jd�S)NT)r'r>)r3r>r!)r-r!r"rV�r2zXBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock_unix.<locals>.<lambda>)rer1)r>r`rr�rTr�rer�rNr&r*r$)r-r�r*r�r!)r-r"�'test_create_datagram_endpoint_sock_unix�s

zFBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock_unixcCsGdd�d�}|jjtd|�d�}|�t|jj|�|jjtd|�d�}|�t|jj|�|jjtd|�d�}|�t|jj|�|jjtd|�d�}|�t|jj|�|jjtd|�d	�}|�t|jj|�|jjtd
|�d�}|�t|jj|�|jjtd
|�d�}|�t|jj|�dS)
Nc@seZdZejZdS)z\BaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock_sockopts.<locals>.FakeSockN)r7r8r9rrr�r!r!r!r"�FakeSock�sr�)z	127.0.0.1r)rkrO)r�rOr))rerO)�protorO)�flagsrOT)r�rO)r�rO)r>r`r3rDr�rT)r-r�r�r!r!r"�+test_create_datagram_endpoint_sock_sockopts�s,zJBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sock_sockoptscs4�jj�fdd�dd�}�j�|�\}}|�d�}ttd�}|rV��|�tjtj	����|�tjtj
��|���j�|j���
d|j��jj�fdd�d|d	d
�}�j�|�\}}|�d�}��|�tjtj��|r���|�tjtj	����|�tjtj
��|���j�|j���
d|j�dS)Ncstd�jd�S)NT)r'r>)r3r>r!)r-r!r"rV�r2zWBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sockopts.<locals>.<lambda>)z	127.0.0.1r)rkrr�r1cstd�jd�S)NT)r'r>)r3r>r!)r-r!r"rV�r2T)rkr�r�)r>r`rTr�rrrM�
getsockoptrr�ZSO_BROADCASTrNr&r*r$rrO)r-r�r*r�rO�reuseport_supportedr!)r-r"�&test_create_datagram_endpoint_sockopts�sH




zEBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_sockoptsc	s@�jj�fdd�ddd�}��t���j�|�WdQRXdS)Ncstd�jd�S)NT)r'r>)r3r>r!)r-r!r"rV�r2zbBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_reuse_address_error.<locals>.<lambda>)z	127.0.0.1rT)rk�
reuse_address)r>r`rDr�rT)r-r�r!)r-r"�1test_create_datagram_endpoint_reuse_address_error�s
zPBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_reuse_address_errorc	sh�jj�fdd�ddd�}��t��:�j�|�\}}|���j�|j���d|j�WdQRXdS)Ncstd�jd�S)NT)r'r>)r3r>r!)r-r!r"rV�r2zdBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_reuse_address_warning.<locals>.<lambda>)z	127.0.0.1rF)rkr�r1)	r>r`ZassertWarns�DeprecationWarningrTrNr&r*r$)r-r�r*r�r!)r-r"�3test_create_datagram_endpoint_reuse_address_warning�s
zRBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_reuse_address_warningcs@|`t��|j_�jj�fdd�ddd�}��t�jj	|�dS)Ncst�jd�S)N)r>)r3r>r!)r-r!r"rVr2z\BaseEventLoopWithSelectorTests.test_create_datagram_endpoint_nosoreuseport.<locals>.<lambda>)z	127.0.0.1rT)rkr�)
r�rr?rrr>r`rDr�rT)r-rr�r!)r-r"�+test_create_datagram_endpoint_nosoreuseports
zJBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_nosoreuseportc	s��fdd�}||_t��|jj_}t���j_d�jj_t	td�}�jj
�fdd�d|d�}�j�|�\}}z&|�d�|jj|j
|j|jd	�Wd|��t��j�XdS)
Ncs��d�dS)Nz"should not have called getaddrinfo)Zfail)r�rA)r-r!r"rszYBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_ip_addr.<locals>.getaddrinfoFr�cst�jd�S)N)r>)r3r>r!)r-r!r"rVr2zVBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_ip_addr.<locals>.<lambda>)z1.2.3.4r)rkr�)rer�r�)rrr?rrrjr>rnrrr`rTr�rrrrNrru)r-rrrjr�r�r�rrr!)r-r"�%test_create_datagram_endpoint_ip_addrs$




zDBaseEventLoopWithSelectorTests.test_create_datagram_endpoint_ip_addrcCs2t��}t�|j_|j�t|�|�|j	j
�dS)N)rr?�BlockingIOError�acceptr<r>�_accept_connectionr"rMrNr�)r-rOr!r!r"�test_accept_connection_retry&s
z;BaseEventLoopWithSelectorTests.test_accept_connection_retryzasyncio.base_events.loggerc
Cs�t��}d|j_ttjd�|j_t��|j	_
t��|j	_|j	�t
|�|�|jj�|�|jj�|j	j
�d�|j	j�tjtjt
|ddtjtj�dS)N�
zToo many open files)rr?�filenorrDr^ZEMFILEr�r<r>Z_remove_readerrkr�r"rOr�r�rMrNr�rZACCEPT_RETRY_DELAYr�)r-Zm_logrOr!r!r"� test_accept_connection_exception-sz?BaseEventLoopWithSelectorTests.test_accept_connection_exceptionc
Cstjdd��}|j�d�|}|�}|�|j�x�||fD]�}|�t��|j�|�WdQRX|�t��|j�	|�WdQRX|�t��|j�
d|�WdQRX|�t��|j�|j��d|�WdQRX|�t��|j�
|j�d|��WdQRXq:WdS)NcSsdS)Nr!r!r!r!r"�simple_coroutine@szLBaseEventLoopWithSelectorTests.test_call_coroutine.<locals>.simple_coroutineTr})rPr�r>rgr�rNrDrirdr�rkryrxrTr)r-r�Z	coro_funcZcoro_objrr!r!r"�test_call_coroutine?s""z2BaseEventLoopWithSelectorTests.test_call_coroutinecCs�dd�}tjdd��}t�|j�|j�d�d|j_|j�||j�|j��|jj	d^}}|�
|t|�d�tj||j�|jd	�|j��|jj	d^}}|�
|t|�d
�dS)NcSs|��dS)N)rw)r>r!r!r"�stop_loop_cbWszLBaseEventLoopWithSelectorTests.test_log_slow_callbacks.<locals>.stop_loop_cbcssdEdH|��dS)Nr!)rw)r>r!r!r"�stop_loop_coroZs
zNBaseEventLoopWithSelectorTests.test_log_slow_callbacks.<locals>.stop_loop_coroTgrz4^Executing <Handle.*stop_loop_cb.*> took .* seconds$)r>z4^Executing <Task.*stop_loop_coro.*> took .* seconds$)
rPr�rBr>rgZslow_callback_durationrdrSZwarningr�rq�tupler�)r-r�r�r�Zfmtr�r!r!r"�test_log_slow_callbacksUs

z6BaseEventLoopWithSelectorTests.test_log_slow_callbacks)Dr7r8r9r<rr$r>r&rLrPrQrRrTrV�unittest�
skipUnlessrrrZr_rarbrcrdrfrmrwrxryrzr{r|r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rZIPV6_ENABLEDr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r!r!r!)rCr"r8
sp!

 )I	

	 /r8c@seZdZdd�ZdS)�RunningLoopTestsc	Cs`tjdd��}t��}t��}z*|�td��|�||��WdQRXWd|��|��XdS)NcSs|��dS)N)rS)r>r!r!r"�runnerwsz@RunningLoopTests.test_running_loop_within_a_loop.<locals>.runnerzwhile another loop is running)rPr�r9rhrRrTrN)r-r�r>Z
outer_loopr!r!r"�test_running_loop_within_a_loopvsz0RunningLoopTests.test_running_loop_within_a_loopN)r7r8r9r�r!r!r!r"r�tsr�cs�eZdZddZGdd�dej�Ze�fdd��Ze�fdd��Z	�fd	d
�Z
d(dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Z�ZS))�BaseLoopSockSendfileTestss�12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcdeic@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)z!BaseLoopSockSendfileTests.MyProtocCs(d|_d|_t�|_|��|_d|_dS)NF)r�closed�	bytearrayr-r'r�r*)r-r>r!r!r"r(�s

z*BaseLoopSockSendfileTests.MyProto.__init__cCsd|_||_dS)NT)rr*)r-r*r!r!r"r,�sz1BaseLoopSockSendfileTests.MyProto.connection_madecCs|j�|�dS)N)r-�extend)r-r-r!r!r"r.�sz/BaseLoopSockSendfileTests.MyProto.data_receivedcCsd|_|j�d�d|_dS)NT)r�r�r�r*)r-r�r!r!r"r2�sz1BaseLoopSockSendfileTests.MyProto.connection_lostc�s|jIdHdS)N)r�)r-r!r!r"rX�sz-BaseLoopSockSendfileTests.MyProto.wait_closedN)r7r8r9r(r,r.r2rXr!r!r!r"r"�s
r"c	s@tj|_dt_ttjd��}|�|j�WdQRXt��	�dS)Ni@�wb)
r�!SENDFILE_FALLBACK_READBUFFER_SIZE�'_BaseLoopSockSendfileTests__old_bufsize�openr�TESTFNr+�DATAr;�
setUpClass)�cls�fp)rCr!r"r��s
z$BaseLoopSockSendfileTests.setUpClasscs"|jt_t�tj�t���dS)N)r�rr�r�unlinkr�r;�
tearDownClass)r�)rCr!r"r��sz'BaseLoopSockSendfileTests.tearDownClasscsJddlm}|�|_|�|j�ttjd�|_|�|jj	�t
���dS)Nr)�BaseSelectorEventLoop�rb)Zasyncio.selector_eventsr�r>rBr�rr��filer�rNr;r<)r-r�)rCr!r"r<�szBaseLoopSockSendfileTests.setUpFcCs*t�tjtj�}|�|�|�|j�|S)N)rrrr�r�rN)r-�blockingrOr!r!r"�make_socket�s
z%BaseLoopSockSendfileTests.make_socketcCs|j�|�S)N)r>rT)r-r�r!r!r"r��sz"BaseLoopSockSendfileTests.run_loopc	s��������j�����jj�fdd�tjdtjd����j	d�
�}xftd�D]F}y���j��|��Wn&t
k
r���t�d��wRYqRXPqRW���j��|������fdd�}��|���fS)	Ncs�S)Nr!r!)r�r!r"rV�r2z3BaseLoopSockSendfileTests.prepare.<locals>.<lambda>r)rer�g�?csD�������������jdk	r@�j��������dS)N)rNr�rXr*r!)r�r-�serverrOr!r"�cleanup�s

z2BaseLoopSockSendfileTests.prepare.<locals>.cleanup)r�r"r>r�rSrZHOSTrrr[Zgetsocknamer�rMrDrPr�r�)r-r5rsr�r!)r�r-r�rOr"�prepare�s 

z!BaseLoopSockSendfileTests.preparec	Csd|��\}}|�tjd�� |�|j�||jdd��WdQRX|�|j	d�|�|j�
�d�dS)Nzsendfile is not availablerr2)r�rhr�SendfileNotAvailableErrorr�r>Z_sock_sendfile_nativer�r*r-�tell)r-rOr�r!r!r"�"test__sock_sendfile_native_failure�sz<BaseLoopSockSendfileTests.test__sock_sendfile_native_failurec	Csd|��\}}|�tjd�� |�|jj||jdd��WdQRX|�|j�	�d�|�|j
d�dS)Nzsendfile is not availableF)�fallbackrr2)r�rhrr�r�r>�
sock_sendfiler�r*r�r-)r-rOr�r!r!r"�test_sock_sendfile_no_fallback�sz8BaseLoopSockSendfileTests.test_sock_sendfile_no_fallbackcCsv|��\}}|�|j�||j��}|��|�|���|�|t|j	��|�|j�
�t|j	��|�|j|j	�dS)N)r�r�r>r�r�rNrXr*r�r�r�r-)r-rOr��retr!r!r"�test_sock_sendfile_fallback�sz5BaseLoopSockSendfileTests.test_sock_sendfile_fallbackcCsv|��\}}|�|j�||jdd��}|��|�|���|�|d�|�|j��d�|�|j	|j
dd��dS)Ni�i�i�)r�r�r>r�r�rNrXr*r�r-r�)r-rOr�r�r!r!r"�,test_sock_sendfile_fallback_offset_and_counts
zFBaseLoopSockSendfileTests.test_sock_sendfile_fallback_offset_and_countc	CsJ|j�d�|jdd�}|�td��|�|j�||j��WdQRXdS)NT)r�zmust be non-blocking)r>rgr�rhr�r�r�r�)r-rOr!r!r"�test_blocking_socketsz.BaseLoopSockSendfileTests.test_blocking_socketc
CsP|��}ttjd��2}|�td��|�|j�||��WdQRXWdQRXdS)Nr=zbinary mode)	r�r�rr�rhr�r�r>r�)r-rOr%r!r!r"�test_nonbinary_filesz-BaseLoopSockSendfileTests.test_nonbinary_filec	CsXt�tjtj�}|�d�|�|j�|�td��|�|j	�
||j��WdQRXdS)NFzonly SOCK_STREAM type)rrrr�r�rNrhr�r�r>r�r�)r-rOr!r!r"�test_nonstream_sockets

z/BaseLoopSockSendfileTests.test_nonstream_socketc	Cs>|��}|�td�� |�|j�||jdd��WdQRXdS)Nz count must be a positive integerrr)r�rhrir�r>r�r�)r-rOr!r!r"�test_notint_count!sz+BaseLoopSockSendfileTests.test_notint_countc	Cs>|��}|�td�� |�|j�||jdd��WdQRXdS)Nz count must be a positive integerrrq)r�rhr�r�r>r�r�)r-rOr!r!r"�test_negative_count'sz-BaseLoopSockSendfileTests.test_negative_countc	Cs<|��}|�td��|�|j�||jd��WdQRXdS)Nz%offset must be a non-negative integer�offset)r�rhrir�r>r�r�)r-rOr!r!r"�test_notint_offset-sz,BaseLoopSockSendfileTests.test_notint_offsetc	Cs<|��}|�td��|�|j�||jd��WdQRXdS)Nz%offset must be a non-negative integerrq)r�rhr�r�r>r�r�)r-rOr!r!r"�test_negative_offset3sz.BaseLoopSockSendfileTests.test_negative_offset)F)r7r8r9r�rPrHr"�classmethodr�r�r<r�r�r�r�r�r�r�r�r�r�r�r�r�r�r!r!r!)rCr"r��s&	
r�c@s.eZdZdd�Ze�eed�d�dd��ZdS)�TestSelectorUtilscCsB|�tjtj�}|�|�t�|�|�tjtj�}|�|�dS)N)r�rr�TCP_NODELAYrMrZ_set_nodelayrO)r-rO�optr!r!r"�check_set_nodelay;s


z#TestSelectorUtils.check_set_nodelayr�zneed socket.TCP_NODELAYc	Csntjtjtjtjd�}|�|�|�WdQRXtjtjtjtjd�}|�|�d�|�|�WdQRXdS)N)rer�r�F)rrrrr�r�)r-rOr!r!r"�test_set_nodelayDs


z"TestSelectorUtils.test_set_nodelayN)	r7r8r9r�r�r�rrr�r!r!r!r"r�:s	r��__main__))�__doc__r^r�r��osrr�r�rxr�rrPrrrZtest.test_asynciorrr�rZtest.support.script_helperrr�r��version_infor�r#r&ZTestCaser'r:rHr"r�r3r8r�r�r�r7r\r!r!r!r"�<module>sX
`Gm5