
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    'â7`O  ã                   @   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ZddlZddl	Z	ddl
mZmZ ddlmZ ddlmZmZmZmZmZmZmZmZ ddl	mZ ddlmZmZ ddlmZ ddlZdd	lm Z m!Z!m"Z" d
dl#m$Z$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-m.Z. d
dl/m0Z0 d
dl1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9 d
dl:m;Z; e�rxddl<m=Z= ndZ=ej>dk�o�ej?dkZ@eAejdœdd„ZBeAeCejdœdd„ZDeCdœdd„ZEG d d!„ d!eƒZFG d"d#„ d#eFƒZGG d$d%„ d%eFƒZHG d&d'„ d'ƒZIG d(d)„ d)e	jJƒZKeeeed*œd+d,„ZLeg ejMf ZNejOejPd-feNeQeejM d.œd/d0„ƒZRejPfeNejMd1œd2d3„ZSdEejMeQdd4œd5d6„ZTejUdœd7d8„ZVdFee= ejWd9œd:d;„ZXdGe+e-d
d
ƒd-de+e+e+e+dd<d=d>œeAeAeee-eQeeeeeee= eCee5d?œd@dA„ZYe+e+feeedBœdCdD„ZZdS )HzUtilities shared by tests.é    N)ÚABCÚabstractmethod)ÚTracebackType)ÚTYPE_CHECKINGÚAnyÚCallableÚIteratorÚListÚOptionalÚTypeÚUnion)Úmock)ÚCIMultiDictÚCIMultiDictProxy)ÚURL)ÚClientResponseÚ_RequestContextManagerÚ_WSRequestContextManageré   )ÚClientSessionÚhdrs)ÚAbstractCookieJar)r   )ÚClientWebSocketResponse)Úsentinel)ÚHttpVersionÚRawRequestMessage)ÚSignal)ÚApplicationÚ	AppRunnerÚ
BaseRunnerÚRequestÚServerÚServerRunnerÚSockSiteÚUrlMappingMatchInfo)Ú_RequestHandler)Ú
SSLContextÚposixÚcygwin)ÚhostÚreturnc                 C   s
   t | dƒS )Nr   )Úget_port_socket)r)   © r,   úE/opt/alt/python38/lib64/python3.8/site-packages/aiohttp/test_utils.pyÚget_unused_port_socket7   s    r.   )r)   Úportr*   c                 C   s8   t   t jt j¡}tr&| t jt jd¡ | | |f¡ |S )Nr   )ÚsocketÚAF_INETÚSOCK_STREAMÚREUSE_ADDRESSÚ
setsockoptÚ
SOL_SOCKETÚSO_REUSEADDRÚbind)r)   r/   Úsr,   r,   r-   r+   ;   s
    r+   ©r*   c               
   C   s>   t   t jt j¡�$} |  d¡ |  ¡ d W  5 Q R £ S Q R X dS )z1Return a port that is unused on the current host.)ú	127.0.0.1r   r   N)r0   r1   r2   r7   Úgetsockname)r8   r,   r,   r-   Úunused_portF   s    
r<   c                	   @   s0  e Zd ZdZedddddœeeef ee	j
 eee eeddœdd„Zd#ee	j
 eddœd	d
„Zeeedœdd„ƒZeedœdd„Zeedœdd„ƒZeedœdd„ƒZeedœdd„ƒZddœdd„Zddœdd„Zeee  ee ee ddœdd„Zd dœdd „Z eee  ee ee ddœd!d"„Z!dS )$ÚBaseTestServerFNr:   )ÚschemeÚloopr)   r/   Úskip_url_asserts)r>   r?   r)   r/   r@   Úkwargsr*   c                K   s4   || _ d | _d | _|| _|| _d| _|| _|| _d S )NF)Ú_loopÚrunnerÚ_rootr)   r/   Ú_closedr>   r@   )Úselfr>   r?   r)   r/   r@   rA   r,   r,   r-   Ú__init__P   s    
zBaseTestServer.__init__)r?   rA   r*   c                 Ë   s  | j r
d S || _| dd ¡| _| jf |ŽI d H | _ | j  ¡ I d H  | jsNd| _t| j| jƒ}| 	¡ d d… \| _| _t
| j || jd�}| ¡ I d H  |j}|d k	s¦t‚|j}|d k	s¸t‚|d  	¡ d | _| jtkrê| jràd}nd}|| _t| j› d| j› d	| j› �ƒ| _d S )
NÚsslr   é   )ÚsockZssl_contextr   ÚhttpsÚhttpz://ú:)rC   rB   ÚpopZ_sslÚ_make_runnerÚsetupr/   r+   r)   r;   r#   ÚstartÚ_serverÚAssertionErrorÚsocketsr>   r   r   rD   )rF   r?   rA   Ú_sockÚsiteÚserverrT   r>   r,   r,   r-   Ústart_serverc   s.    
zBaseTestServer.start_server©rA   r*   c                 Ë   s   d S ©Nr,   ©rF   rA   r,   r,   r-   rO      s    zBaseTestServer._make_runner©Úpathr*   c                 C   sJ   | j d k	st‚t|ƒ}| js4| ¡ r(t‚| j  |¡S tt| j ƒ| ƒS d S rZ   )rD   rS   r   r@   Úis_absoluteÚjoinÚstr)rF   r]   Úurlr,   r,   r-   Úmake_urlƒ   s    zBaseTestServer.make_urlr9   c                 C   s
   | j d k	S rZ   )rC   ©rF   r,   r,   r-   ÚstartedŒ   s    zBaseTestServer.startedc                 C   s   | j S rZ   )rE   rc   r,   r,   r-   Úclosed�   s    zBaseTestServer.closedc                 C   s&   | j }|d k	st‚|jd k	s t‚|jS rZ   )rC   rS   rW   )rF   rC   r,   r,   r-   Úhandler”   s    zBaseTestServer.handlerc                 Ã   s@   | j r<| js<| jdk	st‚| j ¡ I dH  d| _d| _d| _dS )a`  Close all fixtures created by the test client.

        After that point, the TestClient is no longer usable.

        This is an idempotent function: running close multiple times
        will not have any additional effects.

        close is also run when the object is garbage collected, and on
        exit when used as a context manager.

        NT)rd   re   rC   rS   ÚcleanuprD   r/   rE   rc   r,   r,   r-   Úclose�   s    zBaseTestServer.closec                 C   s   t dƒ‚d S ©NzUse async with instead©Ú	TypeErrorrc   r,   r,   r-   Ú	__enter__°   s    zBaseTestServer.__enter__)Úexc_typeÚ	exc_valueÚ	tracebackr*   c                 C   s   d S rZ   r,   ©rF   rm   rn   ro   r,   r,   r-   Ú__exit__³   s    zBaseTestServer.__exit__c                 Ã   s   | j | jd�I d H  | S ©N©r?   )rX   rB   rc   r,   r,   r-   Ú
__aenter__¼   s    zBaseTestServer.__aenter__c                 Ã   s   |   ¡ I d H  d S rZ   ©rh   rp   r,   r,   r-   Ú	__aexit__À   s    zBaseTestServer.__aexit__)N)"Ú__name__Ú
__module__Ú__qualname__Ú__test__r   r   r`   Úobjectr
   ÚasyncioÚAbstractEventLoopÚintÚboolr   rG   rX   r   r   rO   r   rb   Úpropertyrd   re   r!   rf   rh   rl   r   ÚBaseExceptionr   rq   rt   rv   r,   r,   r,   r-   r=   M   sV   ù
÷ ÿ þ	
û	
ûr=   c                       sP   e Zd Zedddœeeeef eee	 e
dœ‡ fdd„Ze
edœdd	„Z‡  ZS )
Ú
TestServerr:   N©r>   r)   r/   )Úappr>   r)   r/   rA   c                   s$   || _ tƒ jf |||dœ|—Ž d S ©Nrƒ   )r„   ÚsuperrG   )rF   r„   r>   r)   r/   rA   ©Ú	__class__r,   r-   rG   Ê   s    	zTestServer.__init__rY   c                 Ë   s   t | jf|ŽS rZ   )r   r„   r[   r,   r,   r-   rO   Ö   s    zTestServer._make_runner)rw   rx   ry   r   r   r   r`   r{   r
   r~   r   rG   r   rO   Ú__classcell__r,   r,   r‡   r-   r‚   É   s   ú
ùr‚   c                       sV   e Zd Zedddœeeeef eee	 e
ddœ‡ fdd„Zdee
edœd	d
„Z‡  ZS )ÚRawTestServerr:   Nrƒ   )rf   r>   r)   r/   rA   r*   c                   s$   || _ tƒ jf |||dœ|—Ž d S r…   )Ú_handlerr†   rG   )rF   rf   r>   r)   r/   rA   r‡   r,   r-   rG   Û   s    	zRawTestServer.__init__T)ÚdebugrA   r*   c                 Ë   s.   t | jf| j|dœ|—Ž}t|fd|i|—ŽS )N)r?   rŒ   rŒ   )r!   r‹   rB   r"   )rF   rŒ   rA   Zsrvr,   r,   r-   rO   ç   s    zRawTestServer._make_runner)T)rw   rx   ry   r   r%   r   r`   r{   r
   r~   r   rG   r   r"   rO   r‰   r,   r,   r‡   r-   rŠ   Ú   s   ú
ørŠ   c                   @   sô  e Zd ZdZdZdddœeee eej	 e
ddœdd„Zddœd	d
„Zeedœdd„ƒZeee dœdd„ƒZeedœdd„ƒZeedœdd„ƒZeedœdd„ƒZeedœdd„Zeee
edœdd„Zeee
edœdd„Zee
edœdd„Zee
edœd d!„Zee
edœd"d#„Zee
edœd$d%„Z ee
edœd&d'„Z!ee
edœd(d)„Z"ee
edœd*d+„Z#ee
e$dœd,d-„Z%ee
e&dœd.d/„Z'ddœd0d1„Z(ddœd2d3„Z)ee*e+  ee+ ee, dd4œd5d6„Z-d dœd7d8„Z.ee*e+  ee+ ee, dd4œd9d:„Z/dS );Ú
TestClientzb
    A test client implementation.

    To write functional tests for aiohttp based servers.

    FN)Ú
cookie_jarr?   )rW   rŽ   r?   rA   r*   c                K   sh   t |tƒstdt|ƒ ƒ‚|| _|| _|d kr<tjd|d�}tf ||dœ|—Ž| _	d| _
g | _g | _d S )Nz2server must be TestServer instance, found type: %rT)Zunsafer?   )r?   rŽ   F)Ú
isinstancer=   rk   ÚtyperR   rB   ÚaiohttpZ	CookieJarr   Ú_sessionrE   Ú
_responsesÚ_websockets)rF   rW   rŽ   r?   rA   r,   r,   r-   rG   ö   s    

ÿzTestClient.__init__r9   c                 Ã   s   | j j| jd�I d H  d S rr   )rR   rX   rB   rc   r,   r,   r-   rX     s    zTestClient.start_serverc                 C   s   | j jS rZ   )rR   r)   rc   r,   r,   r-   r)     s    zTestClient.hostc                 C   s   | j jS rZ   )rR   r/   rc   r,   r,   r-   r/     s    zTestClient.portc                 C   s   | j S rZ   )rR   rc   r,   r,   r-   rW     s    zTestClient.serverc                 C   s   t | jdd ƒS )Nr„   )ÚgetattrrR   rc   r,   r,   r-   r„     s    zTestClient.appc                 C   s   | j S )zðAn internal aiohttp.ClientSession.

        Unlike the methods on the TestClient, client session requests
        do not automatically include the host in the url queried, and
        will require an absolute path to the resource.

        )r’   rc   r,   r,   r-   Úsession  s    	zTestClient.sessionr\   c                 C   s   | j  |¡S rZ   )rR   rb   )rF   r]   r,   r,   r-   rb   )  s    zTestClient.make_url)Úmethodr]   rA   r*   c                 Ë   s.   | j j||  |¡f|ŽI d H }| j |¡ |S rZ   )r’   Úrequestrb   r“   Úappend)rF   r—   r]   rA   Úrespr,   r,   r-   Ú_request,  s    zTestClient._requestc                 K   s   t | j||f|ŽƒS )zÔRoutes a request to tested http server.

        The interface is identical to aiohttp.ClientSession.request,
        except the loop kwarg is overridden by the instance used by the
        test server.

        )r   r›   )rF   r—   r]   rA   r,   r,   r-   r˜   2  s    zTestClient.request)r]   rA   r*   c                 K   s   t | jtj|f|ŽƒS )zPerform an HTTP GET request.)r   r›   r   ZMETH_GET©rF   r]   rA   r,   r,   r-   Úget<  s    zTestClient.getc                 K   s   t | jtj|f|ŽƒS )zPerform an HTTP POST request.)r   r›   r   Z	METH_POSTrœ   r,   r,   r-   Úpost@  s    zTestClient.postc                 K   s   t | jtj|f|ŽƒS )z Perform an HTTP OPTIONS request.)r   r›   r   ZMETH_OPTIONSrœ   r,   r,   r-   ÚoptionsD  s    zTestClient.optionsc                 K   s   t | jtj|f|ŽƒS )zPerform an HTTP HEAD request.)r   r›   r   Z	METH_HEADrœ   r,   r,   r-   ÚheadH  s    zTestClient.headc                 K   s   t | jtj|f|ŽƒS )zPerform an HTTP PUT request.)r   r›   r   ZMETH_PUTrœ   r,   r,   r-   ÚputL  s    zTestClient.putc                 K   s   t | jtj|f|ŽƒS ©zPerform an HTTP PATCH request.)r   r›   r   Z
METH_PATCHrœ   r,   r,   r-   ÚpatchP  s    zTestClient.patchc                 K   s   t | jtj|f|ŽƒS r¢   )r   r›   r   ZMETH_DELETErœ   r,   r,   r-   ÚdeleteT  s    zTestClient.deletec                 K   s   t | j|f|ŽƒS )zjInitiate websocket connection.

        The api corresponds to aiohttp.ClientSession.ws_connect.

        )r   Ú_ws_connectrœ   r,   r,   r-   Ú
ws_connectX  s    zTestClient.ws_connectc                 Ë   s,   | j j|  |¡f|ŽI d H }| j |¡ |S rZ   )r’   r¦   rb   r”   r™   )rF   r]   rA   Úwsr,   r,   r-   r¥   `  s    zTestClient._ws_connectc                 Ã   s^   | j sZ| jD ]}| ¡  q| jD ]}| ¡ I dH  q | j ¡ I dH  | j ¡ I dH  d| _ dS )aH  Close all fixtures created by the test client.

        After that point, the TestClient is no longer usable.

        This is an idempotent function: running close multiple times
        will not have any additional effects.

        close is also run on exit when used as a(n) (asynchronous)
        context manager.

        NT)rE   r“   rh   r”   r’   rR   )rF   rš   r§   r,   r,   r-   rh   e  s    


zTestClient.closec                 C   s   t dƒ‚d S ri   rj   rc   r,   r,   r-   rl   z  s    zTestClient.__enter__)rm   ÚexcÚtbr*   c                 C   s   d S rZ   r,   ©rF   rm   r¨   r©   r,   r,   r-   rq   }  s    zTestClient.__exit__c                 Ã   s   |   ¡ I d H  | S rZ   )rX   rc   r,   r,   r-   rt   †  s    zTestClient.__aenter__c                 Ã   s   |   ¡ I d H  d S rZ   ru   rª   r,   r,   r-   rv   Š  s    zTestClient.__aexit__)0rw   rx   ry   Ú__doc__rz   r=   r
   r   r|   r}   r   rG   rX   r€   r`   r)   r~   r/   rW   r   r„   r   r–   r   rb   r   r›   r   r˜   r�   rž   rŸ   r    r¡   r£   r¤   r   r¦   r   r¥   rh   rl   r   r�   r   rq   rt   rv   r,   r,   r,   r-   r�   ì   s^   ûù


û	
ûr�   c                   @   s„   e Zd ZdZedœdd„Zedœdd„Zddœdd	„Zddœd
d„Zddœdd„Z	ddœdd„Z
eedœdd„Zeedœdd„ZdS )ÚAioHTTPTestCasea  A base class to allow for unittest web applications using
    aiohttp.

    Provides the following:

    * self.client (aiohttp.test_utils.TestClient): an aiohttp test client.
    * self.loop (asyncio.BaseEventLoop): the event loop in which the
        application and server are running.
    * self.app (aiohttp.web.Application): the application returned by
        self.get_application()

    Note that the TestClient's methods are asynchronous: you have to
    execute function on the test client using asynchronous methods.
    r9   c                 Ã   s   |   ¡ S )zy
        This method should be overridden
        to return the aiohttp.web.Application
        object to test.

        )Úget_apprc   r,   r,   r-   Úget_application£  s    zAioHTTPTestCase.get_applicationc                 C   s   t dƒ‚dS )zqObsolete method used to constructing web application.

        Use .get_application() coroutine instead

        z+Did you forget to define get_application()?N)ÚRuntimeErrorrc   r,   r,   r-   r­   ¬  s    zAioHTTPTestCase.get_appNc                 C   sl   t ƒ | _| j |  ¡ ¡| _| j |  | j¡¡| _| j |  | j¡¡| _| j | j 	¡ ¡ | j |  
¡ ¡ d S rZ   )Úsetup_test_loopr?   Úrun_until_completer®   r„   Ú
get_serverrW   Ú
get_clientÚclientrX   Ú
setUpAsyncrc   r,   r,   r-   ÚsetUp´  s    zAioHTTPTestCase.setUpc                 Ã   s   d S rZ   r,   rc   r,   r,   r-   rµ   ¿  s    zAioHTTPTestCase.setUpAsyncc                 C   s0   | j  |  ¡ ¡ | j  | j ¡ ¡ t| j ƒ d S rZ   )r?   r±   ÚtearDownAsyncr´   rh   Úteardown_test_looprc   r,   r,   r-   ÚtearDownÂ  s    zAioHTTPTestCase.tearDownc                 Ã   s   d S rZ   r,   rc   r,   r,   r-   r·   Ç  s    zAioHTTPTestCase.tearDownAsync)r„   r*   c                 Ã   s   t || jd�S )zReturn a TestServer instance.rs   )r‚   r?   )rF   r„   r,   r,   r-   r²   Ê  s    zAioHTTPTestCase.get_server)rW   r*   c                 Ã   s   t || jd�S )zReturn a TestClient instance.rs   )r�   r?   )rF   rW   r,   r,   r-   r³   Î  s    zAioHTTPTestCase.get_client)rw   rx   ry   r«   r   r®   r­   r¶   rµ   r¹   r·   r‚   r²   r�   r³   r,   r,   r,   r-   r¬   “  s   	r¬   )ÚfuncÚargsrA   r*   c                    s.   t jˆ f|ž|Žttttdœ‡ fdd„ƒ}|S )z·A decorator dedicated to use with asynchronous methods of an
    AioHTTPTestCase.

    Handles executing an asynchronous function, using
    the self.loop of the AioHTTPTestCase.
    )rF   Ú
inner_argsÚinner_kwargsr*   c                    s   | j  ˆ | f|ž|Ž¡S rZ   )r?   r±   )rF   r¼   r½   ©rº   r,   r-   Únew_funcÛ  s    z#unittest_run_loop.<locals>.new_func)Ú	functoolsÚwrapsr   )rº   r»   rA   r¿   r,   r¾   r-   Úunittest_run_loopÓ  s    rÂ   F)Úloop_factoryÚfastr*   c                 c   s   t | ƒ}|V  t||d� dS )zzA contextmanager that creates an event_loop, for test purposes.

    Handles the creation and cleanup of a test loop.
    )rÄ   N)r°   r¸   )rÃ   rÄ   r?   r,   r,   r-   Úloop_contextå  s    rÅ   )rÃ   r*   c              	   C   sŠ   | ƒ }z|j j}d|k}W n tk
r2   d}Y nX t |¡ tjdkr†|s†t ¡ }t ¡ }| 	|¡ t
 t¡� | |¡ W 5 Q R X |S )z˜Create and return an asyncio.BaseEventLoop
    instance.

    The caller should also call teardown_test_loop,
    once they are done with the loop.
    ZuvloopTÚwin32)rˆ   rx   ÚAttributeErrorr|   Úset_event_loopÚsysÚplatformZget_event_loop_policyZSafeChildWatcherZattach_loopÚ
contextlibÚsuppressÚNotImplementedErrorZset_child_watcher)rÃ   r?   ÚmoduleZskip_watcherÚpolicyZwatcherr,   r,   r-   r°   ò  s    	


r°   )r?   rÄ   r*   c                 C   sB   |   ¡ }|s(|  | j¡ |  ¡  |  ¡  |s4t ¡  t d¡ dS )zHTeardown and cleanup an event_loop created
    by setup_test_loop.

    N)	Z	is_closedZ	call_soonÚstopZrun_foreverrh   ÚgcZcollectr|   rÈ   )r?   rÄ   re   r,   r,   r-   r¸     s    r¸   c                  C   s^   t tt dœdd„} t tt d dœdd„}t ¡ }i |_| |_||_d|_t|ƒ|_	|j	 
¡  |S )N)r„   Úkeyr*   c                 S   s
   | j | S rZ   ©Ú
__app_dict)r„   rÒ   r,   r,   r-   Úget_dict  s    z"_create_app_mock.<locals>.get_dict)r„   rÒ   Úvaluer*   c                 S   s   || j |< d S rZ   rÓ   )r„   rÒ   rÖ   r,   r,   r-   Úset_dict!  s    z"_create_app_mock.<locals>.set_dictF)r   r`   r   Ú	MagicMockrÔ   Ú__getitem__Ú__setitem__Z_debugr   Zon_response_prepareZfreeze)rÕ   r×   r„   r,   r,   r-   Ú_create_app_mock  s    

rÛ   )Ú
sslcontextr*   c                    s,   t  ¡ }ttt dœ‡ fdd„}||j_|S )N)rÒ   r*   c                    s   | dkrˆ S d S d S )NrÜ   r,   )rÒ   ©rÜ   r,   r-   Úget_extra_info2  s    z)_create_transport.<locals>.get_extra_info)r   ÚMockr`   r
   r&   rÞ   Úside_effect)rÜ   Ú	transportrÞ   r,   rÝ   r-   Ú_create_transport/  s    râ   i   .)Ú
match_infoÚversionÚclosingr„   ÚwriterÚprotocolrá   ÚpayloadrÜ   Úclient_max_sizer?   )r—   r]   Úheadersrã   rä   rå   r„   ræ   rç   rá   rè   rÜ   ré   r?   r*   c                C   st  t  ¡ }|dkr t  ¡ }d|j_|tddƒk r2d}|rZtt|ƒƒ}tdd„ | ¡ D ƒƒ}nttƒ ƒ}d}d| 	t
jd¡ ¡ k}t| |||||d	d	|t|ƒƒ
}|d
krªtƒ }|	tkrºt|ƒ}	|tkrÐt  ¡ }|	|_|tk�rt  ¡ }td
ƒ|_td
ƒ|_td
ƒ|_td
ƒ|_|	|_|	|_||_|
tk�r.t  ¡ }
t||
|||||d�}t|tk�rTi n|t  ¡ ƒ}| |¡ ||_|S )z²Creates mocked web.Request testing purposes.

    Useful in unit tests, when spinning full web server is overkill or
    specific conditions and errors are hard to trigger.

    .r,   r   Tc                 s   s&   | ]\}}|  d ¡|  d ¡fV  qdS )zutf-8N)Úencode)Ú.0ÚkÚvr,   r,   r-   Ú	<genexpr>^  s    z&make_mocked_request.<locals>.<genexpr>ÚchunkedÚ FN)ré   )r   rß   Zcreate_futureÚreturn_valuer   r   r   ÚtupleÚitemsr�   r   ZTRANSFER_ENCODINGÚlowerr   r   rÛ   r   râ   rá   Úmake_mocked_coroZwrite_headersÚwriteZ	write_eofZdrainræ   r    r$   Zadd_appZ_match_info)r—   r]   rê   rã   rä   rå   r„   ræ   rç   rá   rè   rÜ   ré   r?   ZtaskZraw_hdrsrð   ÚmessageÚreqr,   r,   r-   Úmake_mocked_request<  sx    ÿ

ö





      ÿ ÿ
rú   )rò   Úraise_exceptionr*   c                    s$   t t t dœ‡ ‡fdd„}tj|d�S )zCreates a coroutine mock.)r»   rA   r*   c                  Ÿ   s(   ˆ t k	rˆ ‚t ˆ¡sˆS ˆI d H  d S rZ   )r   ÚinspectÚisawaitable)r»   rA   ©rû   rò   r,   r-   Ú	mock_coro�  s
    
z#make_mocked_coro.<locals>.mock_coro)rÁ   )r   r   rß   )rò   rû   rÿ   r,   rþ   r-   rö   ˜  s    rö   )F)N)N)[r«   r|   rË   rÀ   rÑ   rü   Úosr0   rÉ   ZunittestÚabcr   r   Útypesr   Útypingr   r   r   r   r	   r
   r   r   r   Z	multidictr   r   Zyarlr   r‘   Zaiohttp.clientr   r   r   rñ   r   r   r   Zclient_reqrepZ	client_wsr   Zhelpersr   rL   r   r   Zsignalsr   Zwebr   r   r   r    r!   r"   r#   r$   Zweb_protocolr%   rH   r&   ÚnamerÊ   r3   r`   r.   r~   r+   r<   r=   r‚   rŠ   r�   ZTestCaser¬   rÂ   r}   Z_LOOP_FACTORYÚcontextmanagerZnew_event_loopr   rÅ   r°   r¸   rØ   rÛ   rß   râ   rú   rö   r,   r,   r,   r-   Ú<module>   s¼   ((
| (@ ÿ þÿþ ýñð] ÿ þ