a
    åze¼Q  ã                   @   sÔ  d Z ddlZddlZddlZddlZddlZddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZ zddlZW n eyž   dZY n0 d	d
„ ZG dd„ dejƒZG dd„ dejƒZG dd„ dƒZG dd„ deƒZG dd„ deƒZG dd„ deeƒZejdkrBG dd„ deejƒZG dd„ deejƒZn|ddlZe edƒrjG dd„ deejƒZ!e edƒrŠG d d!„ d!eejƒZ"e ed"ƒrªG d#d$„ d$eejƒZ#G d%d„ deejƒZe$d&krÐe %¡  dS )'z!Tests for sendfile functionality.é    N)Úbase_events)Ú	constants)Úmock)Úsupport)Úsocket_helper)Úutilsc                   C   s   t  d ¡ d S ©N)ÚasyncioZset_event_loop_policy© r
   r
   ú5/usr/lib/python3.9/test/test_asyncio/test_sendfile.pyÚtearDownModule   s    r   c                       s>   e Zd Zddd„Zdd„ Zdd„ Zd	d
„ Z‡ fdd„Z‡  ZS )ÚMySendfileProtoNr   c                 C   s@   d | _ d| _d| _|d ur.| ¡ | _| ¡ | _tƒ | _|| _d S )NZINITIALr   )	Ú	transportÚstateÚnbytesÚcreate_futureÚ	connectedÚdoneÚ	bytearrayÚdataÚclose_after)ÚselfÚloopr   r
   r
   r   Ú__init__   s    

zMySendfileProto.__init__c                 C   s"   || _ d| _| jr| j d ¡ d S )NZ	CONNECTED)r   r   r   Ú
set_result©r   r   r
   r
   r   Úconnection_made&   s    zMySendfileProto.connection_madec                 C   s
   d| _ d S )NZEOF)r   ©r   r
   r
   r   Úeof_received-   s    zMySendfileProto.eof_receivedc                 C   s   d| _ | jr| j d ¡ d S )NZCLOSED)r   r   r   ©r   Úexcr
   r
   r   Úconnection_lost1   s    zMySendfileProto.connection_lostc                    sJ   |  j t|ƒ7  _ | j |¡ tƒ  |¡ | jrF| j | jkrF| j ¡  d S r   )	r   Úlenr   ÚextendÚsuperÚdata_receivedr   r   Úclose©r   r   ©Ú	__class__r
   r   r%   7   s
    zMySendfileProto.data_received)Nr   )	Ú__name__Ú
__module__Ú__qualname__r   r   r   r!   r%   Ú__classcell__r
   r
   r(   r   r      s
   

r   c                   @   s4   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ ZdS )ÚMyProtoc                 C   s(   d| _ d| _tƒ | _| ¡ | _d | _d S ©NF)ÚstartedÚclosedr   r   r   Úfutr   )r   r   r
   r
   r   r   B   s
    
zMyProto.__init__c                 C   s   d| _ || _d S ©NT)r0   r   r   r
   r
   r   r   I   s    zMyProto.connection_madec                 C   s   | j  |¡ d S r   )r   r#   r'   r
   r
   r   r%   M   s    zMyProto.data_receivedc                 C   s   d| _ | j d ¡ d S r3   )r1   r2   r   r   r
   r
   r   r!   P   s    zMyProto.connection_lostc                 Ã   s   | j I d H  d S r   )r2   r   r
   r
   r   Úwait_closedT   s    zMyProto.wait_closedN)r*   r+   r,   r   r   r%   r!   r4   r
   r
   r
   r   r.   @   s
   r.   c                       sd   e Zd Zdd ZdZdd„ Ze‡ fdd„ƒZe‡ fdd	„ƒZ‡ fd
d„Z	‡ fdd„Z
dd„ Z‡  ZS )ÚSendfileBaseó   xi  é   c                 C   s   t ‚d S r   )ÚNotImplementedErrorr   r
   r
   r   Úcreate_event_loopd   s    zSendfileBase.create_event_loopc                    sF   t tjdƒ}| | j¡ W d   ƒ n1 s.0    Y  tƒ  ¡  d S )NÚwb)Úopenr   ÚTESTFNÚwriteÚDATAr$   Ú
setUpClass)ÚclsÚfpr(   r
   r   r?   g   s    *zSendfileBase.setUpClassc                    s   t  t j¡ tƒ  ¡  d S r   )r   Úunlinkr<   r$   ÚtearDownClass©r@   r(   r
   r   rC   m   s    zSendfileBase.tearDownClassc                    s@   t tjdƒ| _|  | jj¡ |  ¡ | _|  | j¡ t	ƒ  
¡  d S )NÚrb)r;   r   r<   ÚfileÚ
addCleanupr&   r9   r   Zset_event_loopr$   ÚsetUpr   r(   r
   r   rH   r   s
    
zSendfileBase.setUpc                    s4   | j  ¡ st | j ¡ |  ¡  t ¡  tƒ  ¡  d S r   )	r   Z	is_closedÚ
test_utilsZrun_brieflyZ
doCleanupsr   Ú
gc_collectr$   ÚtearDownr   r(   r
   r   rK   y   s
    
zSendfileBase.tearDownc                 C   s   | j  |¡S r   )r   Úrun_until_complete)r   Úcoror
   r
   r   Úrun_loop‚   s    zSendfileBase.run_loop)r*   r+   r,   r>   ÚBUF_SIZEr9   Úclassmethodr?   rC   rH   rK   rN   r-   r
   r
   r(   r   r5   X   s   	r5   c                       st   e Zd Ze‡ fdd„ƒZe‡ fdd„ƒZddd„Zdd	„ Zddd„Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Z‡  ZS )ÚSockSendfileMixinc                    s   t j| _dt _tƒ  ¡  d S )Ni @  )r   Ú!SENDFILE_FALLBACK_READBUFFER_SIZEÚ_SockSendfileMixin__old_bufsizer$   r?   rD   r(   r
   r   r?   ˆ   s    zSockSendfileMixin.setUpClassc                    s   | j t_tƒ  ¡  d S r   )rS   r   rR   r$   rC   rD   r(   r
   r   rC   Ž   s    zSockSendfileMixin.tearDownClassTc                 C   s.   t   t jt j¡}| d¡ |r*|  |j¡ |S r/   )ÚsocketÚAF_INETÚSOCK_STREAMÚsetblockingrG   r&   )r   ÚcleanupÚsockr
   r
   r   Úmake_socket“   s
    
zSockSendfileMixin.make_socketc                 C   s   |  tjtj| j¡ d S r   )Ú
setsockoptrT   Ú
SOL_SOCKETÚ	SO_RCVBUFrO   )r   rY   r
   r
   r   Úreduce_receive_buffer_sizeš   s    z,SockSendfileMixin.reduce_receive_buffer_sizeNc                 C   s.   |  tjtj| j¡ |d ur*|j| jd d S )N)Úhigh)r[   rT   r\   Ú	SO_SNDBUFrO   Zset_write_buffer_limits)r   rY   r   r
   r
   r   Úreduce_send_buffer_sizeŸ   s    z)SockSendfileMixin.reduce_send_buffer_sizec                    s¢   t ˆjƒ‰ t ¡ }ˆjdd}| tj|f¡ ˆ ˆjj‡ fdd„|d¡‰ˆ 	|¡ ˆ ¡ }ˆ ˆj 
|d|f¡¡ ˆ |¡ ‡ ‡‡fdd„}ˆ |¡ |ˆ fS )	NF)rX   c                      s   ˆ S r   r
   r
   )Úprotor
   r   Ú<lambda>¯   ó    z8SockSendfileMixin.prepare_socksendfile.<locals>.<lambda>)rY   z	127.0.0.1c                      s<   ˆ j d ur"ˆ j  ¡  ˆ ˆ  ¡ ¡ ˆ ¡  ˆ ˆ ¡ ¡ d S r   )r   r&   rN   r4   r
   ©rb   r   Úserverr
   r   rX   ¶   s
    

z7SockSendfileMixin.prepare_socksendfile.<locals>.cleanup)r.   r   r   Úfind_unused_portrZ   ÚbindÚHOSTrN   Úcreate_serverr^   Zsock_connectra   rG   )r   ÚportÚsrv_sockrY   rX   r
   re   r   Úprepare_socksendfile©   s    

ÿ



z&SockSendfileMixin.prepare_socksendfilec                 C   sv   |   ¡ \}}|  | j || j¡¡}| ¡  |  | ¡ ¡ |  |t| j	ƒ¡ |  |j
| j	¡ |  | j ¡ t| j	ƒ¡ d S r   )rm   rN   r   Úsock_sendfilerF   r&   r4   ÚassertEqualr"   r>   r   Útell©r   rY   rb   Úretr
   r
   r   Útest_sock_sendfile_successÄ   s    z,SockSendfileMixin.test_sock_sendfile_successc                 C   sv   |   ¡ \}}|  | j || jdd¡¡}| ¡  |  | ¡ ¡ |  |j| j	dd… ¡ |  | j 
¡ d¡ |  |d¡ d S )Néè  iÐ  i¸  )rm   rN   r   rn   rF   r&   r4   ro   r   r>   rp   rq   r
   r
   r   Ú(test_sock_sendfile_with_offset_and_countÎ   s    ÿz:SockSendfileMixin.test_sock_sendfile_with_offset_and_countc              	   C   s„   |   ¡ \}}t ¡ (}|  | j ||dd ¡¡}W d   ƒ n1 sB0    Y  | ¡  |  | ¡ ¡ |  |d¡ |  | j	 
¡ d¡ d S )Nr   )rm   ÚtempfileÚTemporaryFilerN   r   rn   r&   r4   ro   rF   rp   )r   rY   rb   Úfrr   r
   r
   r   Útest_sock_sendfile_zero_sizeÙ   s    
ÿ$z.SockSendfileMixin.test_sock_sendfile_zero_sizec                 C   s²   dd }|   ¡ \}}|  | j ||¡¡ |  | j || j¡¡}|  | j ||¡¡ | ¡  |  | ¡ ¡ |  |t	| j
ƒ¡ || j
 | }|  |j|¡ |  | j ¡ t	| j
ƒ¡ d S )Ns   mix_regular_sendr7   )rm   rN   r   Zsock_sendallrn   rF   r&   r4   ro   r"   r>   r   rp   )r   ÚbufrY   rb   rr   Zexpectedr
   r
   r   Ú(test_sock_sendfile_mix_with_regular_sendä   s    z:SockSendfileMixin.test_sock_sendfile_mix_with_regular_send)T)N)r*   r+   r,   rP   r?   rC   rZ   r^   ra   rm   rs   ru   ry   r{   r-   r
   r
   r(   r   rQ   †   s   



rQ   c                   @   sÖ   e Zd Zdddœdd„Ze ejdkd¡dd	„ ƒZd
d„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Ze ej d ¡d!¡d"d#„ ƒZd$d%„ Ze eed&ƒ d'¡d(d)„ ƒZd*d+„ Zd,S )-ÚSendfileMixinFr   ©Úis_sslr   c                   s   t  ¡ }tˆj|d‰|r:ts(ˆ d¡ t ¡ }t ¡ }nd }d }t	 	t	j
t	j¡}| t j|f¡ ˆ ˆjj‡fdd„||d¡‰ˆ |¡ |r˜t j}nd }t	 	t	j
t	j¡}| t j|f¡ tˆjd‰ ˆ ˆjj‡ fdd„|||d¡\}	}
ˆj||	d	 ‡ ‡‡‡fd
d„}ˆ |¡ ˆˆ fS )N)r   r   zNo ssl modulec                      s   ˆ S r   r
   r
   )Ú	srv_protor
   r   rc     rd   z0SendfileMixin.prepare_sendfile.<locals>.<lambda>)rY   Ússl)r   c                      s   ˆ S r   r
   r
   )Ú	cli_protor
   r   rc     rd   )rY   r€   Úserver_hostname)r   c                      sF   ˆj  ¡  ˆ j  ¡  ˆ ˆj¡ ˆ ˆ j¡ ˆ ¡  ˆ ˆ ¡ ¡ d S r   )r   r&   rN   r   r4   r
   ©r   r   rf   r   r
   r   rX     s    

z/SendfileMixin.prepare_sendfile.<locals>.cleanup)r   rg   r   r   r€   ÚskipTestrI   Zsimple_server_sslcontextZsimple_client_sslcontextrT   rU   rV   rh   ri   rN   rj   r^   ÚconnectÚcreate_connectionra   rG   )r   r~   r   rk   Zsrv_ctxZcli_ctxrl   r‚   Zcli_sockÚtrÚprrX   r
   rƒ   r   Úprepare_sendfile÷   s>    ÿ


ÿ

þ	
zSendfileMixin.prepare_sendfileÚwin32zUDP sockets are not supportedc                 C   sŽ   |   | jjtjtjd¡\}}z`|  td¡& |   | j 	|| j
¡¡ W d   ƒ n1 sX0    Y  |  d| j
 ¡ ¡ W | ¡  n
| ¡  0 d S )N)Úfamilyúnot supportedr   )rN   r   Zcreate_datagram_endpointr	   ZDatagramProtocolrT   rU   ÚassertRaisesRegexÚRuntimeErrorÚsendfilerF   ro   rp   r&   )r   r‡   rˆ   r
   r
   r   Útest_sendfile_not_supported"  s    þÿÿ"z)SendfileMixin.test_sendfile_not_supportedc                 C   sŒ   |   ¡ \}}|  | j |j| j¡¡}|j ¡  |  |j¡ |  |t	| j
ƒ¡ |  |jt	| j
ƒ¡ |  |j| j
¡ |  | j ¡ t	| j
ƒ¡ d S r   ©r‰   rN   r   r   r   rF   r&   r   ro   r"   r>   r   r   rp   ©r   r   r   rr   r
   r
   r   Útest_sendfile1  s    ÿ
zSendfileMixin.test_sendfilec                    s    ˆ   ¡ \}}‡ fdd„}|ˆ j_ˆ  ˆ j |jˆ j¡¡}|j ¡  ˆ  |j¡ ˆ  	|t
ˆ jƒ¡ ˆ  	|jt
ˆ jƒ¡ ˆ  	|jˆ j¡ ˆ  	ˆ j ¡ t
ˆ jƒ¡ d S )Nc                    s   t j ˆ j| |||¡S r   ©r   ZBaseEventLoopÚ_sendfile_nativer   ©ZtransprF   ÚoffsetÚcountr   r
   r   Úsendfile_native?  s    ÿzCSendfileMixin.test_sendfile_force_fallback.<locals>.sendfile_native)r‰   r   r•   rN   r   r   rF   r&   r   ro   r"   r>   r   r   rp   )r   r   r   r™   rr   r
   r   r   Útest_sendfile_force_fallback<  s    ÿ
z*SendfileMixin.test_sendfile_force_fallbackc                    sÆ   t jdkr"tˆ jtjƒr"ˆ  d¡ ˆ  ¡ \}}‡ fdd„}|ˆ j_ˆ  	tj
d¡, ˆ  ˆ jj|jˆ jdd¡ W d   ƒ n1 s‚0    Y  |j ¡  ˆ  |j¡ ˆ  |jd¡ ˆ  ˆ j ¡ d¡ d S )	NrŠ   zFails on proactor event loopc                    s   t j ˆ j| |||¡S r   r”   r–   r   r
   r   r™   U  s    ÿzMSendfileMixin.test_sendfile_force_unsupported_native.<locals>.sendfile_nativerŒ   F©Úfallbackr   )ÚsysÚplatformÚ
isinstancer   r	   ÚProactorEventLoopr„   r‰   r•   r   ZSendfileNotAvailableErrorrN   r   r   rF   r&   r   ro   r   rp   )r   r   r   r™   r
   r   r   Ú&test_sendfile_force_unsupported_nativeO  s$    

ÿÿÿ"
z4SendfileMixin.test_sendfile_force_unsupported_nativec                 C   s   | j dd\}}|  | j |j| j¡¡}|j ¡  |  |j¡ |  |t	| j
ƒ¡ |  |jt	| j
ƒ¡ |  |j| j
¡ |  | j ¡ t	| j
ƒ¡ d S )NT©r~   r‘   r’   r
   r
   r   Útest_sendfile_sslg  s    ÿ
zSendfileMixin.test_sendfile_sslc                 C   sŠ   |   ¡ \}}|j ¡  |  td¡( |  | j |j| j¡¡ W d   ƒ n1 sP0    Y  |  |j	¡ |  
|jd¡ |  
| j ¡ d¡ d S )Nz
is closingr   )r‰   r   r&   r   rŽ   rN   r   r   rF   r   ro   r   rp   ©r   r   r   r
   r
   r   Ú test_sendfile_for_closing_transpr  s    
6z.SendfileMixin.test_sendfile_for_closing_transpc                 C   s¨   |   ¡ \}}dd }dd }|j |¡ |  | j |j| j¡¡}|j |¡ |j ¡  |  |j¡ |  	|t
| jƒ¡ |  	|j|| j | ¡ |  	| j ¡ t
| jƒ¡ d S )Ns   PREFIX__é   s   --SUFFIX©r‰   r   r=   rN   r   r   rF   r&   r   ro   r"   r>   r   rp   ©r   r   r   ZPREFIXZSUFFIXrr   r
   r
   r   Útest_sendfile_pre_and_post_data{  s    ÿ
z-SendfileMixin.test_sendfile_pre_and_post_datac                 C   s¬   | j dd\}}dd }dd }|j |¡ |  | j |j| j¡¡}|j |¡ |j ¡  |  |j¡ |  	|t
| jƒ¡ |  	|j|| j | ¡ |  	| j ¡ t
| jƒ¡ d S )NTr¢   s   zxcvbnmr¦   s
   0987654321r§   r¨   r
   r
   r   Ú#test_sendfile_ssl_pre_and_post_data‰  s    ÿ
z1SendfileMixin.test_sendfile_ssl_pre_and_post_datac                 C   s†   |   ¡ \}}|  | j |j| jdd¡¡}|j ¡  |  |j¡ |  |d¡ |  |j	d¡ |  |j
| jdd… ¡ |  | j ¡ d¡ d S )Nrt   éd   éL  ©r‰   rN   r   r   r   rF   r&   r   ro   r   r   r>   rp   r’   r
   r
   r   Útest_sendfile_partial—  s    ÿ
z#SendfileMixin.test_sendfile_partialc                 C   sŠ   | j dd\}}|  | j |j| jdd¡¡}|j ¡  |  |j¡ |  |d¡ |  |j	d¡ |  |j
| jdd… ¡ |  | j ¡ d¡ d S )NTr¢   rt   r«   r¬   r­   r’   r
   r
   r   Útest_sendfile_ssl_partial¢  s    ÿ
z'SendfileMixin.test_sendfile_ssl_partialc                 C   s–   | j t| jƒd\}}|  | j |j| j¡¡}|j ¡  |  |j	¡ |  
|t| jƒ¡ |  
|jt| jƒ¡ |  
|j| j¡ |  
| j ¡ t| jƒ¡ d S )N©r   )r‰   r"   r>   rN   r   r   r   rF   r&   r   ro   r   r   rp   r’   r
   r
   r   Ú(test_sendfile_close_peer_after_receiving­  s    ÿ
ÿ
z6SendfileMixin.test_sendfile_close_peer_after_receivingc                 C   sŽ   | j dt| jƒd\}}|  | j |j| j¡¡}|  |j¡ |  	|t| jƒ¡ |  	|j
t| jƒ¡ |  	|j| j¡ |  	| j ¡ t| jƒ¡ d S )NTr}   )r‰   r"   r>   rN   r   r   r   rF   r   ro   r   r   rp   r’   r
   r
   r   Ú,test_sendfile_ssl_close_peer_after_receiving¹  s    
ÿ
ÿz:SendfileMixin.test_sendfile_ssl_close_peer_after_receivingZsunoszDoesn't work on Solarisc                 C   sÎ   | j dd\}}|  t¡( |  | j |j| j¡¡ W d   ƒ n1 sH0    Y  |  |j¡ |  	d|j
  ko|t| jƒk n  |j
¡ |  	d| j ¡   koªt| jƒk n  | j ¡ ¡ |  	|j ¡ ¡ d S )Nr¦   r°   )r‰   ÚassertRaisesÚConnectionErrorrN   r   r   r   rF   r   Ú
assertTruer   r"   r>   rp   Ú
is_closingr¤   r
   r
   r   Ú3test_sendfile_close_peer_in_the_middle_of_receivingÈ  s    ÿ""ÿ&ÿzASendfileMixin.test_sendfile_close_peer_in_the_middle_of_receivingc                    sÒ   ‡ fdd„}|ˆ j _ˆ jdd\}}ˆ  t¡( ˆ  ˆ j  |jˆ j¡¡ W d   ƒ n1 s\0    Y  ˆ  |j	¡ ˆ  
d|j  kotˆ jƒk n  |j¡ ˆ  
dˆ j ¡   ko¾tˆ jƒk n  ˆ j ¡ ¡ d S )Nc                    s   t j ˆ j| |||¡S r   r”   r–   r   r
   r   r™   Ù  s    ÿzcSendfileMixin.test_sendfile_fallback_close_peer_in_the_middle_of_receiving.<locals>.sendfile_nativer¦   r°   )r   r•   r‰   r³   r´   rN   r   r   rF   r   rµ   r   r"   r>   rp   )r   r™   r   r   r
   r   r   Ú<test_sendfile_fallback_close_peer_in_the_middle_of_receiving×  s    ÿ""ÿ&ÿzJSendfileMixin.test_sendfile_fallback_close_peer_in_the_middle_of_receivingr   z"Don't have native sendfile supportc                    s–   ˆ  ¡ \}‰ ˆj ¡ ‰‡ ‡‡fdd„}ˆj |ƒ ¡}ˆ ˆ¡ ˆ td¡ ˆ j d¡ W d   ƒ n1 sl0    Y  ˆ |¡}ˆ 	|t
ˆjƒ¡ d S )Nc                   “   s"   ˆ  d ¡ ˆj ˆ jˆj¡I d H S r   )r   r   r   r   rF   r
   ©r   r2   r   r
   r   rM   ñ  s    
z=SendfileMixin.test_sendfile_prevents_bare_write.<locals>.corozsendfile is in progresss   data)r‰   r   r   Zcreate_taskrN   r   rŽ   r   r=   ro   r"   r>   )r   r   rM   Útrr   r
   r¹   r   Ú!test_sendfile_prevents_bare_writeë  s    

ÿ*
z/SendfileMixin.test_sendfile_prevents_bare_writec                 C   sh   t  ¡ }dd„ |j_tjj|_|  t	d¡* | j
 | j
j|d dd¡ W d   ƒ n1 sZ0    Y  d S )Nc                   S   s   dS r/   r
   r
   r
   r
   r   rc   ÿ  rd   zPSendfileMixin.test_sendfile_no_fallback_for_fallback_transport.<locals>.<lambda>zfallback is disabledFr›   )r   ZMockr¶   Zside_effectr   Z_SendfileModeZFALLBACKZ_sendfile_compatibler   rŽ   r   rL   r   r   r
   r
   r   Ú0test_sendfile_no_fallback_for_fallback_transportý  s    
ÿz>SendfileMixin.test_sendfile_no_fallback_for_fallback_transportN)r*   r+   r,   r‰   ÚunittestZskipIfr   rž   r   r“   rš   r¡   r£   r¥   r©   rª   r®   r¯   r±   r²   Ú
startswithr·   r¸   ÚhasattrÚosr»   r¼   r
   r
   r
   r   r|   ó   s0   +
	ÿ
ÿ
r|   c                   @   s   e Zd ZdS )ÚSendfileTestsBaseN)r*   r+   r,   r
   r
   r
   r   rÁ     s   rÁ   rŠ   c                   @   s   e Zd Zdd„ ZdS )ÚSelectEventLoopTestsc                 C   s   t  ¡ S r   )r	   ÚSelectorEventLoopr   r
   r
   r   r9     s    ú&SelectEventLoopTests.create_event_loopN©r*   r+   r,   r9   r
   r
   r
   r   rÂ     s   rÂ   c                   @   s   e Zd Zdd„ ZdS )ÚProactorEventLoopTestsc                 C   s   t  ¡ S r   )r	   r    r   r
   r
   r   r9     s    z(ProactorEventLoopTests.create_event_loopNrÅ   r
   r
   r
   r   rÆ     s   rÆ   ÚKqueueSelectorc                   @   s   e Zd Zdd„ ZdS )ÚKqueueEventLoopTestsc                 C   s   t  t ¡ ¡S r   )r	   rÃ   Ú	selectorsrÇ   r   r
   r
   r   r9     s    ÿz&KqueueEventLoopTests.create_event_loopNrÅ   r
   r
   r
   r   rÈ     s   rÈ   ÚEpollSelectorc                   @   s   e Zd Zdd„ ZdS )ÚEPollEventLoopTestsc                 C   s   t  t ¡ ¡S r   )r	   rÃ   rÉ   rÊ   r   r
   r
   r   r9   '  s    z%EPollEventLoopTests.create_event_loopNrÅ   r
   r
   r
   r   rË   $  s   rË   ÚPollSelectorc                   @   s   e Zd Zdd„ ZdS )ÚPollEventLoopTestsc                 C   s   t  t ¡ ¡S r   )r	   rÃ   rÉ   rÌ   r   r
   r
   r   r9   .  s    z$PollEventLoopTests.create_event_loopNrÅ   r
   r
   r
   r   rÍ   +  s   rÍ   c                   @   s   e Zd Zdd„ ZdS )rÂ   c                 C   s   t  t ¡ ¡S r   )r	   rÃ   rÉ   ÚSelectSelectorr   r
   r
   r   r9   5  s    rÄ   NrÅ   r
   r
   r
   r   rÂ   2  s   Ú__main__)&Ú__doc__r	   rÀ   rT   r   rv   r½   r   r   r   Útestr   Ztest.supportr   Ztest.test_asyncior   rI   r€   ÚImportErrorr   ÚProtocolr   r.   r5   rQ   r|   rÁ   rž   ZTestCaserÂ   rÆ   rÉ   r¿   rÈ   rË   rÍ   r*   Úmainr
   r
   r
   r   Ú<module>   sd   
&.m  ÿÿÿÿÿÿ
