Your IP : 3.16.49.213


Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/aiohttp/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/aiohttp/__pycache__/test_utils.cpython-311.pyc

�

��bg�N� �`�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZmZddl
mZddlmZmZmZmZmZmZmZmZmZddlmZmZddlmZddlmZm Z dd	l!m"Z"ddl#Z#dd
l$m%Z%m&Z&ddl'm(Z(m)Z)dd
l
m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2m3Z3ddl4m5Z5ddl6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>ddl?m@Z@erddlAmBZBndZBejCdko
ejDdkZEejFfdeGdejHdejfd�ZIdeGdeJdejHdejfd�ZKdeJfd�ZLGd�d e��ZMGd!�d"eM��ZNGd#�d$eM��ZOGd%�d&��ZPGd'�d(e��ZQd)ed*ed+edefd,�ZRegejSfZTejUejVd-fd.eTd/eWdeejSfd0���ZXejVfd.eTdejSfd1�ZYdJd2ejSd/eWddfd3�ZZdej[fd4�Z\dKd5eeBdej]fd6�Z^	dKe0e2dd��d-de0e0e0e0dd7d8d9�d:eGd;eGd<ed=ed>e2d?eWd@edAedBedCedDed5eeBdEeJd2ede:fdF�Z_e0e0fdGedHedefdI�Z`dS)LzUtilities shared by tests.�N)�ABC�abstractmethod)�
TracebackType)	�
TYPE_CHECKING�Any�Callable�Iterator�List�Optional�Type�Union�cast)�IsolatedAsyncioTestCase�mock)�Signal)�CIMultiDict�CIMultiDictProxy)�URL)�_RequestContextManager�_WSRequestContextManager�)�
ClientSession�hdrs)�AbstractCookieJar)�ClientResponse)�ClientWebSocketResponse)�sentinel)�HttpVersion�RawRequestMessage)�StrOrURL)�Application�	AppRunner�
BaseRunner�Request�Server�ServerRunner�SockSite�UrlMappingMatchInfo)�_RequestHandler)�
SSLContext�posix�cygwin�host�family�returnc�$�t|d|��S)Nr)�get_port_socket)r-r.s  �e/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib64/python3.11/site-packages/aiohttp/test_utils.py�get_unused_port_socketr3=s���4��F�+�+�+��portc���tj|tj��}tr+|�tjtjd��|�||f��|S)Nr)�socket�SOCK_STREAM�
REUSE_ADDRESS�
setsockopt�
SOL_SOCKET�SO_REUSEADDR�bind)r-r5r.�ss    r2r1r1CsZ��	�
�f�f�0�1�1�A��@�	
���V�&��(;�Q�?�?�?��F�F�D�$�<�����Hr4c��tjtjtj��5}|�d��t	t
|���d��cddd��S#1swxYwYdS)z1Return a port that is unused on the current host.)�	127.0.0.1rrN)r7�AF_INETr8r=r�int�getsockname)r>s r2�unused_portrDPs���	��v�~�v�'9�	:�	:�-�a�	���� � � ��C�������+�,�,�-�-�-�-�-�-�-�-�-�-�-�-����-�-�-�-�-�-s�AA9�9A=�A=c��eZdZdZedddded�deeefde	e
jdede	ed	e
d
eeeejgejfdeddfd
�Z	dde	e
jdeddfd�Zededefd���Zdedefd�Zede
fd���Zede
fd���Zedefd���Zdd�Zdd�Z de	e!e"de	e"de	e#ddfd�Z$dd�Z%de	e!e"de	e"de	e#ddfd�Z&dS) �BaseTestServerFNr@)�scheme�loopr-r5�skip_url_asserts�socket_factoryrGrHr-r5rIrJ�kwargsr/c��||_d|_d|_||_||_d|_||_||_||_dS)NF)	�_loop�runner�_rootr-r5�_closedrGrIrJ)�selfrGrHr-r5rIrJrKs        r2�__init__zBaseTestServer.__init__ZsK����
�,0���$(��
���	���	������� 0���,����r4c��K�|jrdS||_|�dd��|_|jdddi|���d{V��|_|j����d{V��|jsd|_	tj|j	��j
}n#t$rd}YnwxYw|dkrtj
ntj}|�|j	|j|��}|���dd�\|_	|_t#|j||j���}|����d{V��|j}|�J�|j}|�J�|d���d	|_|jt,ur|jrd
}	nd}	|	|_t/|j�d|j	�d
|j����|_dS)N�ssl�handler_cancellationTr���)�sock�ssl_contextr�https�httpz://�:�)rNrM�pop�_ssl�_make_runner�setupr5�	ipaddress�
ip_addressr-�version�
ValueErrorr7�AF_INET6rArJrCr'�start�_server�socketsrGrrrO)
rQrHrKrer.�_sock�site�serverrjrGs
          r2�start_serverzBaseTestServer.start_serverqs�����;�	��F���
��J�J�u�d�+�+��	�-�D�-�R�R�4�R�6�R�R�R�R�R�R�R�R����k���!�!�!�!�!�!�!�!�!��y�	��D�I�	��*�4�9�5�5�=�G�G���	�	�	��G�G�G�	����$+�q�L�L����f�n���#�#�D�I�t�y�&�A�A��$�0�0�2�2�2�A�2�6���	�4�9����%�T�Y�G�G�G���j�j�l�l������������!�!�!��.���"�"�"��A�J�*�*�,�,�Q�/��	��;�(�"�"��y�
 � ����� �D�K��D�K�C�C�D�I�C�C��	�C�C�D�D��
�
�
s�6B�B$�#B$c��
K�dS�Nr^�rQrKs  r2razBaseTestServer._make_runner�s�����r4�pathc��|j�J�t|��}|js0|���rJ�|j�|��Stt|j��t|��z��Srp)rOrrI�is_absolute�join�str)rQrr�urls   r2�make_urlzBaseTestServer.make_url�sq���z�%�%�%��$�i�i���$�	4����(�(�(�(�(��:�?�?�3�'�'�'��s�4�:����T���2�3�3�3r4c��|jduSrp)rN�rQs r2�startedzBaseTestServer.started�s���{�$�&�&r4c��|jSrp)rPrzs r2�closedzBaseTestServer.closed��
���|�r4c�8�|j}|�J�|j�J�|jSrp)rNrm)rQrNs  r2�handlerzBaseTestServer.handler�s-������!�!�!��}�(�(�(��}�r4c��K�|jrF|jsA|j�J�|j����d{V��d|_d|_d|_dSdSdS)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)r{r}rN�cleanuprOr5rPrzs r2�closezBaseTestServer.close�s|�����<�	 ���	 ��;�*�*�*��+�%�%�'�'�'�'�'�'�'�'�'��D�J��D�I��D�L�L�L�	 �	 �	 �	 r4c� �td����NzUse async with instead��	TypeErrorrzs r2�	__enter__zBaseTestServer.__enter__�����0�1�1�1r4�exc_type�	exc_value�	tracebackc��dSrpr^�rQr�r�r�s    r2�__exit__zBaseTestServer.__exit__��	��	
�r4c��LK�|�|j����d{V��|S�N�rH)rnrMrzs r2�
__aenter__zBaseTestServer.__aenter__�s6�������T�Z��0�0�0�0�0�0�0�0�0��r4c��>K�|����d{V��dSrp�r�r�s    r2�	__aexit__zBaseTestServer.__aexit__��.�����j�j�l�l���������r4rp�r/N)r/rF)'�__name__�
__module__�__qualname__�__test__rr1r
rv�objectr�asyncio�AbstractEventLooprB�boolrr7�
AddressFamilyrrRrnrr#rar rrx�propertyr{r}r%r�r�r�r�
BaseExceptionrr�r�r�r^r4r2rFrFWs��������H�
&.�48��"�!&�
�-�-�-��c�6�k�"�-��w�0�1�	-�
�-��s�m�
-��-�!�
�#�v�+�,�f�m�;�
�-��-�
�-�-�-�-�0;?�E�E��W�6�7�E�JM�E�	
�E�E�E�E�B�
�3�
�:�
�
�
��^�
�4�X�4�#�4�4�4�4��'��'�'�'��X�'��������X���������X�� � � � �&2�2�2�2�
��4�
�.�/�
��M�*�
��M�*�	
�

�
�
�
�
�������4�
�.�/���M�*���M�*�	�

������r4rFc�j��eZdZeddd�dedeeefdedee	de
f
�fd	�Zde
d
efd�Z
�xZS)�
TestServerr@N�rGr-r5�apprGr-r5rKc�P��||_t��jd|||d�|��dS�Nr�r^)r��superrR)rQr�rGr-r5rK�	__class__s      �r2rRzTestServer.__init__�s8�����������G��T��G�G��G�G�G�G�Gr4r/c��*K�t|jfi|��Srp)r"r�rqs  r2razTestServer._make_runner�s�������,�,�V�,�,�,r4)r�r�r�rr!r
rvr�rrBrrRr#ra�
__classcell__�r�s@r2r�r��s��������
&.��"�
H�
H�
H�
�
H��c�6�k�"�	
H�
�
H��s�m�
H��
H�
H�
H�
H�
H�
H�-�3�-�:�-�-�-�-�-�-�-�-r4r�c
�t��eZdZeddd�dedeeefdedee	de
d	df�fd
�Zddede
d	e
fd
�Z�xZS)�
RawTestServerr@Nr�r�rGr-r5rKr/c�P��||_t��jd|||d�|��dSr�)�_handlerr�rR)rQr�rGr-r5rKr�s      �r2rRzRawTestServer.__init__�s8��� ��
������G��T��G�G��G�G�G�G�Gr4T�debugc��XK�t|jf|j|d�|��}t|fd|i|��S)N)rHr�r�)r%r�rMr&)rQr�rK�srvs    r2razRawTestServer._make_runner�sA�����T�]�K���5�K�K�F�K�K���C�7�7�u�7��7�7�7r4)T)r�r�r�rr)r
rvr�rrBrrRr�r&rar�r�s@r2r�r��s��������
&.��"�
H�
H�
H� �
H��c�6�k�"�	
H�
�
H��s�m�
H��
H�
�
H�
H�
H�
H�
H�
H�8�8��8�s�8�|�8�8�8�8�8�8�8�8r4r�c��eZdZdZdZddd�dedeedeej	de
d	df
d
�Zd'd�Ze
d	efd���Ze
d	eefd
���Ze
d	efd���Ze
d	eefd���Ze
d	efd���Zded	efd�Zdedede
d	efd�Zdedede
d	efd�Zdede
d	efd�Zdede
d	efd�Zdede
d	efd�Z dede
d	efd�Z!dede
d	efd�Z"dede
d	efd�Z#dede
d	efd�Z$dede
d	e%fd�Z&dede
d	e'fd�Z(d'd�Z)d'd �Z*d!ee+e,d"ee,d#ee-d	dfd$�Z.d(d%�Z/d!ee+e,d"ee,d#ee-d	dfd&�Z0dS))�
TestClientzb
    A test client implementation.

    To write functional tests for aiohttp based servers.

    FN)�
cookie_jarrHrmr�rHrKr/c��t|t��stdt|��z���||_||_|�t
jd|���}td||d�|��|_	d|_
g|_g|_dS)Nz2server must be TestServer instance, found type: %rT)�unsaferH)rHr�Fr^)
�
isinstancerFr��typerirM�aiohttp�	CookieJarr�_sessionrP�
_responses�_websockets)rQrmr�rHrKs     r2rRzTestClient.__init__	s����&�.�1�1�	��G�$�v�,�,�V���
������
��� �*�$�T�B�B�B�J�%�Q�4�J�Q�Q�&�Q�Q��
����02���:<����r4c��VK�|j�|j����d{V��dSr�)rirnrMrzs r2rnzTestClient.start_servers9�����l�'�'�T�Z�'�8�8�8�8�8�8�8�8�8�8�8r4c��|jjSrp)rir-rzs r2r-zTestClient.host!�
���|� � r4c��|jjSrp)rir5rzs r2r5zTestClient.port%r�r4c��|jSrp)rirzs r2rmzTestClient.server)r~r4c�j�tttt|jdd����S)Nr�)rrr!�getattrrirzs r2r�zTestClient.app-s%���H�[�)�7�4�<���+M�+M�N�N�Nr4c��|jS)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�rzs r2�sessionzTestClient.session1s���}�r4rrc�6�|j�|��Srp)rirx)rQrrs  r2rxzTestClient.make_url<s���|�$�$�T�*�*�*r4�methodc��K�|jj||�|��fi|���d{V��}|j�|��|Srp)r��requestrxr��append)rQr�rrrK�resps     r2�_requestzTestClient._request?s_����+�T�]�*�6�4�=�=��3F�3F�Q�Q�&�Q�Q�Q�Q�Q�Q�Q�Q������t�$�$�$��r4c�:�t|j||fi|����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.

        )rr�)rQr�rrrKs    r2r�zTestClient.requestGs(��&�m�d�m�F�D�&K�&K�F�&K�&K�L�L�Lr4c�N�t|jtj|fi|����S)zPerform an HTTP GET request.)rr�r�METH_GET�rQrrrKs   r2�getzTestClient.getS�(��%�m�d�m�D�M�4�&R�&R�6�&R�&R�S�S�Sr4c�N�t|jtj|fi|����S)zPerform an HTTP POST request.)rr�r�	METH_POSTr�s   r2�postzTestClient.postW�(��%�m�d�m�D�N�D�&S�&S�F�&S�&S�T�T�Tr4c�N�t|jtj|fi|����S)z Perform an HTTP OPTIONS request.)rr�r�METH_OPTIONSr�s   r2�optionszTestClient.options[s)��%�m�d�m�D�4E�t�&V�&V�v�&V�&V�W�W�Wr4c�N�t|jtj|fi|����S)zPerform an HTTP HEAD request.)rr�r�	METH_HEADr�s   r2�headzTestClient.head_r�r4c�N�t|jtj|fi|����S)zPerform an HTTP PUT request.)rr�r�METH_PUTr�s   r2�putzTestClient.putcr�r4c�N�t|jtj|fi|����S�zPerform an HTTP PATCH request.)rr�r�
METH_PATCHr�s   r2�patchzTestClient.patchgs(��%�m�d�m�D�O�T�&T�&T�V�&T�&T�U�U�Ur4c�N�t|jtj|fi|����Sr�)rr�r�METH_DELETEr�s   r2�deletezTestClient.deleteks)��%�m�d�m�D�4D�d�&U�&U�f�&U�&U�V�V�Vr4c�8�t|j|fi|����S)zjInitiate websocket connection.

        The api corresponds to aiohttp.ClientSession.ws_connect.

        )r�_ws_connectr�s   r2�
ws_connectzTestClient.ws_connectos(��(�(8��(8��(H�(H��(H�(H�I�I�Ir4c��K�|jj|�|��fi|���d{V��}|j�|��|Srp)r�r�rxr�r�)rQrrrK�wss    r2r�zTestClient._ws_connectws^����,�4�=�+�D�M�M�$�,?�,?�J�J�6�J�J�
J�
J�
J�
J�
J�
J�������#�#�#��	r4c��*K�|js�|jD]}|����|jD]}|����d{V���|j����d{V��|j����d{V��d|_dSdS)aHClose 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)rPr�r�r�r�ri)rQr�r�s   r2r�zTestClient.close~s������|�	 ���
�
���
�
������&�
!�
!���h�h�j�j� � � � � � � � ��-�%�%�'�'�'�'�'�'�'�'�'��,�$�$�&�&�&�&�&�&�&�&�&��D�L�L�L�	 �	 r4c� �td���r�r�rzs r2r�zTestClient.__enter__�r�r4r��exc�tbc��dSrpr^�rQr�r�r�s    r2r�zTestClient.__exit__�r�r4c��>K�|����d{V��|Srp)rnrzs r2r�zTestClient.__aenter__�s/�������!�!�!�!�!�!�!�!�!��r4c��>K�|����d{V��dSrpr�r�s    r2r�zTestClient.__aexit__�r�r4r�)r/r�)1r�r�r��__doc__r�rFrrr�r�rrRrnr�rvr-rBr5rmr!r�rr�r rrxrr�rr�r�r�r�r�r�r�r�rr�rr�r�r�rr�rr�r�r�r^r4r2r�r��s����������H�37�48�=�=�=��=��.�/�	=�
�w�0�1�=��
=�
�=�=�=�=�*9�9�9�9��!�c�!�!�!��X�!��!�h�s�m�!�!�!��X�!��������X���O�X�k�*�O�O�O��X�O��������X��+�X�+�#�+�+�+�+����!)��58��	�����
M��
M�!)�
M�58�
M�	�
M�
M�
M�
M�T��T�C�T�4J�T�T�T�T�U��U�S�U�5K�U�U�U�U�X�H�X��X�8N�X�X�X�X�U��U�S�U�5K�U�U�U�U�T��T�C�T�4J�T�T�T�T�V�(�V�c�V�6L�V�V�V�V�W�8�W�s�W�7M�W�W�W�W�J�x�J�3�J�;S�J�J�J�J����(+��	 ����� � � � �*2�2�2�2�
��4�
�.�/�
��m�
$�
�
�]�#�	
�

�
�
�
�
�������4�
�.�/���m�
$��
�]�#�	�

������r4r�c�j�eZdZdZdefd�Zdefd�Zdd�Zdd�Zdd�Z	dd	�Z
d
edefd�Zdede
fd
�ZdS)�AioHTTPTestCaseaA 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.
    r/c��.K�|���S)z�Get application.

        This method should be overridden
        to return the aiohttp.web.Application
        object to test.
        )�get_apprzs r2�get_applicationzAioHTTPTestCase.get_application�s�����|�|�~�~�r4c� �td���)zqObsolete method used to constructing web application.

        Use .get_application() coroutine instead.
        z+Did you forget to define get_application()?)�RuntimeErrorrzs r2r�zAioHTTPTestCase.get_app�s��
�H�I�I�Ir4Nc��jK�tj��|_|����d{V��Srp)r��get_running_looprH�
setUpAsyncrzs r2�
asyncSetUpzAioHTTPTestCase.asyncSetUp�s8�����,�.�.��	��_�_�&�&�&�&�&�&�&�&�&r4c��K�|����d{V��|_|�|j���d{V��|_|�|j���d{V��|_|j����d{V��dSrp)r�r��
get_serverrm�
get_client�clientrnrzs r2rzAioHTTPTestCase.setUpAsync�s������-�-�/�/�/�/�/�/�/�/��� �O�O�D�H�5�5�5�5�5�5�5�5��� �O�O�D�K�8�8�8�8�8�8�8�8����k�&�&�(�(�(�(�(�(�(�(�(�(�(r4c��:K�|����d{V��Srp)�
tearDownAsyncrzs r2�
asyncTearDownzAioHTTPTestCase.asyncTearDown�s*�����'�'�)�)�)�)�)�)�)�)�)r4c��HK�|j����d{V��dSrp)r	r�rzs r2rzAioHTTPTestCase.tearDownAsync�s2�����k���!�!�!�!�!�!�!�!�!�!�!r4r�c��2K�t||j���S)zReturn a TestServer instance.r�)r�rH)rQr�s  r2rzAioHTTPTestCase.get_server�s�����#�D�I�.�.�.�.r4rmc��2K�t||j���S)zReturn a TestClient instance.r�)r�rH)rQrms  r2rzAioHTTPTestCase.get_client�s�����&�t�y�1�1�1�1r4r�)r�r�r�r�r!r�r�rrrrr�rr�rr^r4r2r�r��s����������{�����J��J�J�J�J�'�'�'�'�)�)�)�)�*�*�*�*�"�"�"�"�/�K�/�J�/�/�/�/�2�z�2�j�2�2�2�2�2�2r4r��func�argsrKc�>�tjdtd���|S)zw
    A decorator dedicated to use with asynchronous AioHTTPTestCase test methods.

    In 3.8+, this does nothing.
    zBDecorator `@unittest_run_loop` is no longer needed in aiohttp 3.8+rX)�
stacklevel)�warnings�warn�DeprecationWarning)rrrKs   r2�unittest_run_loopr�s-��
�M�L�������
�Kr4F�loop_factory�fastc#�RK�t|��}|V�t||���dS)zzA contextmanager that creates an event_loop, for test purposes.

    Handles the creation and cleanup of a test loop.
    )rN)�setup_test_loop�teardown_test_loop)rrrHs   r2�loop_contextr�s7�����<�(�(�D�
�J�J�J��t�$�'�'�'�'�'�'r4c�B�|��}tj|��|S)z�Create and return an asyncio.BaseEventLoop instance.

    The caller should also call teardown_test_loop,
    once they are done with the loop.
    )r��set_event_loop)rrHs  r2rrs%���<�>�>�D���4� � � ��Kr4rHc��|���}|sB|�|j��|���|���|stj��tjd��dS)z>Teardown and cleanup an event_loop created by setup_test_loop.N)	�	is_closed�	call_soon�stop�run_foreverr��gc�collectr�r)rHrr}s   r2rrsv��
�^�^�
�
�F������t�y�!�!�!��������
�
������
�
������4� � � � � r4c�4�dtdtdtfd�}dtdtdtddfd�}tjt���}i|_||_||_d|_t|��|_
|j
���|S)	Nr��keyr/c��|j|Srp��
__app_dict)r�r(s  r2�get_dictz"_create_app_mock.<locals>.get_dicts���~�c�"�"r4�valuec��||j|<dSrpr*)r�r(r-s   r2�set_dictz"_create_app_mock.<locals>.set_dict"s��#���s���r4)�specF)rrvr�	MagicMockr!r+�__getitem__�__setitem__�_debugr�on_response_prepare�freeze)r,r/r�s   r2�_create_app_mockr7s���#�c�#��#��#�#�#�#�$�c�$��$�C�$�D�$�$�$�$��.�k�
*�
*�
*�C��C�N��C�O��C�O��C�J�$�S�k�k�C����"�"�$�$�$��Jr4�
sslcontextc���tj��}dtdttf�fd�}||j_|S)Nr(r/c���|dkr�SdS)Nr8r^)r(r8s �r2�get_extra_infoz)_create_transport.<locals>.get_extra_info3s����,������4r4)r�Mockrvrr*r;�side_effect)r8�	transportr;s`  r2�_create_transportr?0sR����	���I��C��H�Z�$8�������,:�I��(��r4i.)�
match_infore�closingr��writer�protocolr>�payloadr8�client_max_sizerHr�rr�headersr@rerAr�rBrCr>rDrEc��tj��}|
durtj��}
d|
j_|t	dd��krd}|rHtt
|����}td�|���D����}ntt
����}d}d|�	tjd�����v}t||||||dd	|t|���
�
}|�t��}|	t urt#|��}	|t urtj��}|	|_|t urjtj��}t'd��|_t'd��|_t'd��|_t'd��|_|	|_|	|_||_|
t urtj��}
t3||
||||
|�
��}t5|t urin|tj����}|�|��||_|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^rTc3�pK�|]1\}}|�d��|�d��fV��2dS)zutf-8N)�encode)�.0�k�vs   r2�	<genexpr>z&make_mocked_request.<locals>.<genexpr>]sT����
�
�7;�q�!�Q�X�X�g�
�
����� 1� 1�2�
�
�
�
�
�
r4�chunked�NF)rE)rr<�
create_future�return_valuerrr�tuple�itemsr�r�TRANSFER_ENCODING�lowerrrr7rr?r>�make_mocked_coro�
write_headers�write�	write_eof�drainrBr$r(�add_app�_match_info)r�rrrFr@rerAr�rBrCr>rDr8rErH�task�raw_hdrsrN�message�reqs                   r2�make_mocked_requestra=sD��,�9�;�;�D��s�{�{��y�{�{��*,���'���Q��"�"�"�"�����"�;�w�#7�#7�8�8���
�
�?F�}�}���
�
�
�
�
���#�;�=�=�1�1�����7�;�;�t�'=�r�B�B�H�H�J�J�J�G���������
���D�	�	���G��{�� � ���H���%�j�1�1�	��8����9�;�;��&���
���������/��5�5���'��-�-���+�D�1�1���'��-�-���$���"�H���H�O��(����)�+�+��
���(�F�D�$�����C�%��H�$�$���*�d�i�k�k���J����s���� �C�O��Jr4rQ�raise_exceptionc�h���dtdtdtf��fd�}tj|���S)zCreates a coroutine mock.rrKr/c��^�K��tur��tj���s�S��d{V��dSrp)r�inspect�isawaitable)rrKrbrQs  ��r2�	mock_coroz#make_mocked_coro.<locals>.mock_coro�sO������(�*�*�!�!��"�<�0�0�	 ������������r4)�wraps)rrr<)rQrbrgs`` r2rVrV�sQ����
�s��c��c���������9�9�%�%�%�%r4)Frp)ar�r��
contextlibr%rerc�osr7�sysr�abcrr�typesr�typingrrrr	r
rrr
r�unittestrr�	aiosignalr�	multidictrr�yarlrr��aiohttp.clientrrrOrrr�
client_reqrepr�	client_wsr�helpersrr\rr�typedefsr �webr!r"r#r$r%r&r'r(�web_protocolr)rTr*�name�platformr9rArvr�r3rBr1rDrFr�r�r�r�rr��
_LOOP_FACTORY�contextmanager�new_event_loopr�rrrr1r7r<r?rarVr^r4r2�<module>rs��� � ���������	�	�	�	���������	�	�	�	�
�
�
�
�
�
�
�
�����#�#�#�#�#�#�#�#�������
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�3�2�2�2�2�2�2�2�������3�3�3�3�3�3�3�3�����������K�K�K�K�K�K�K�K�!�!�!�!�!�!�!�!�"�"�"�"�"�"�)�)�)�)�)�)�.�.�.�.�.�.�������0�0�0�0�0�0�0�0�������	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�*�)�)�)�)�)�����������J���7�"�?�s�|�x�'?�
�/5�n�,�,�

�,��+�,��]�,�,�,�,�

�

�

��

�"(�"6�

��]�

�

�

�

�-�S�-�-�-�-�B�B�B�B�B�S�B�B�B�J-�-�-�-�-��-�-�-�"8�8�8�8�8�N�8�8�8�$j�j�j�j�j�j�j�j�Z62�62�62�62�62�-�62�62�62�r�C����s��s�������W�6�6�7�
���")�"8�u�	(�	(��	(�@D�	(�
�g�'�(�	(�	(�	(���	(�#*�"8�
�
��
���
�
�
�
�!�!�W�6�!�d�!�t�!�!�!�!��$�.�����$
�
�(�:�"6�
�$�)�
�
�
�
� �W�
�&�;�q�!�,�,�������'+�"��W�W�W��W�

�W��W�
�W��
W��W�

�W�
�W��W��W��W���$�W��W��W� 
�!W�W�W�W�v!��&�&��&�36�&��&�&�&�&�&�&r4

?>