HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/hyperflight/apps/inxpress/.venv/Lib/site-packages/flask/__pycache__/testing.cpython-311.pyc
�

��i�'��T�ddlmZddlZddlZddlmZddlmZddl	m	Z	ddl
mZddlm
Z
ddlZddlmZdd	lmZdd
lmZddlmZdd
lmZddlmZejrddlmZddlmZddlm Z Gd�dej!j"��Z"da#dd�Z$Gd�de��Z%Gd�de��Z&dS)�)�annotationsN)�contextmanager)�	ExitStack)�copy)�
TracebackType)�urlsplit)�	CliRunner)�Result)�Client)�Request�)�
ScriptInfo)�SessionMixin)�WSGIEnvironment)�TestResponse)�Flaskc�6��eZdZdZ				dd�fd�
Zdd�Z�xZS)�EnvironBuildera�An :class:`~werkzeug.test.EnvironBuilder`, that takes defaults from the
    application.

    :param app: The Flask application to configure the environment from.
    :param path: URL path being requested.
    :param base_url: Base URL where the app is being served, which
        ``path`` is relative to. If not given, built from
        :data:`PREFERRED_URL_SCHEME`, ``subdomain``,
        :data:`SERVER_NAME`, and :data:`APPLICATION_ROOT`.
    :param subdomain: Subdomain name to append to :data:`SERVER_NAME`.
    :param url_scheme: Scheme to use instead of
        :data:`PREFERRED_URL_SCHEME`.
    :param json: If given, this is serialized as JSON and passed as
        ``data``. Also defaults ``content_type`` to
        ``application/json``.
    :param args: other positional arguments passed to
        :class:`~werkzeug.test.EnvironBuilder`.
    :param kwargs: other keyword arguments passed to
        :class:`~werkzeug.test.EnvironBuilder`.
    �/N�appr�path�str�base_url�
str | None�	subdomain�
url_scheme�args�t.Any�kwargs�return�Nonec����|s|s|r!|dut|p|��ks
Jd���|��|j�d��pd}|jd}	|r|�d|��}|�
|jd}t|��}
|
jp|�d|
jp|�d|	�d����}|
j}|
jr|�d	|
j��}||_	t��j||g|�Ri|��dS)
Nz8Cannot pass "subdomain" or "url_scheme" with "base_url".�SERVER_NAME�	localhost�APPLICATION_ROOT�.�PREFERRED_URL_SCHEMEz://r�?)�bool�config�getr�scheme�netloc�lstripr�queryr�super�__init__)�selfrrrrrrr�	http_host�app_root�url�	__class__s           ��ID:\web\hyperflight\apps\inxpress\.venv\Lib\site-packages\flask/testing.pyr1zEnvironBuilder.__init__1se����	
�	�	
�Z�	
��D� �
�)�)�z�
*�
*�=+�	
�	
�
G�	
�	
�	
��	-��
���}�5�5�D��I��z�"4�5�H��
7�(�6�6�9�6�6�	��
@� �Z�(>�?�
��4�.�.�C��:�+��+�+��
�0G�i�+�+��O�O�C�(�(�+�+�
��8�D��y�
-��,�,���,�,�����������x�9�$�9�9�9�&�9�9�9�9�9��objc�2�|jjj|fi|��S)z�Serialize ``obj`` to a JSON-formatted string.

        The serialization will be configured according to the config associated
        with this EnvironBuilder's ``app``.
        )r�json�dumps)r2r9rs   r7�
json_dumpszEnvironBuilder.json_dumpsXs#��#�t�x�}�"�3�1�1�&�1�1�1r8)rNNN)rrrrrrrrrrrrrrr r!)r9rrrr r)�__name__�
__module__�__qualname__�__doc__r1r=�
__classcell__�r6s@r7rrso���������0�#� $�!%�
%:�%:�%:�%:�%:�%:�%:�N2�2�2�2�2�2�2�2r8r�r rc�\�tstj�d��atS)N�werkzeug)�_werkzeug_version�	importlib�metadata�version�r8r7�_get_werkzeug_versionrLds*���C�%�.�6�6�z�B�B���r8c�|��eZdZUdZded<d"�fd	�Zed#d���Zd$d�Zd%d�Z	ddd�d&�fd�Z
d'd�Zd(d!�Z�xZ
S))�FlaskClientaWorks like a regular Werkzeug test client but has knowledge about
    Flask's contexts to defer the cleanup of the request context until
    the end of a ``with`` block. For general information about how to
    use this class refer to :class:`werkzeug.test.Client`.

    .. versionchanged:: 0.12
       `app.test_client()` includes preset default environment, which can be
       set after instantiation of the `app.test_client()` object in
       `client.environ_base`.

    Basic usage is outlined in the :doc:`/testing` chapter.
    r�applicationrrrr r!c���t��j|i|��d|_g|_t	��|_ddt
����d�|_dS)NFz	127.0.0.1z	Werkzeug/)�REMOTE_ADDR�HTTP_USER_AGENT)r0r1�preserve_context�
_new_contextsr�_context_stackrL�environ_base)r2rrr6s   �r7r1zFlaskClient.__init__}se��������$�)�&�)�)�)� %���<>���'�k�k���&�D�+@�+B�+B�D�D�
�
����r8�t.Iterator[SessionMixin]c/�K�|j�td���|j}|j|i|��}|�|jj��|5|j�||j��}ddd��n#1swxYwY|�td���|V�|�
��}|j�|��rdS|5|j�|||��ddd��n#1swxYwY|�
|jj�d��d|jj|j�d����dS)a�When used in combination with a ``with`` statement this opens a
        session transaction.  This can be used to modify the session that
        the test client uses.  Once the ``with`` block is left the session is
        stored back.

        ::

            with client.session_transaction() as session:
                session['value'] = 42

        Internally this is implemented by going through a temporary test
        request context and since session handling could depend on
        request variables this function accepts the same arguments as
        :meth:`~flask.Flask.test_request_context` which are directly
        passed through.
        Nz>Cookies are disabled. Create a client with 'use_cookies=True'.z'Session backend did not open a session.�:rz
Set-Cookie)�_cookies�	TypeErrorrO�test_request_context�_add_cookies_to_wsgi�request�environ�session_interface�open_session�RuntimeError�response_class�is_null_session�save_session�_update_cookies_from_response�host�	partitionr�headers�getlist)r2rrr�ctx�sess�resps       r7�session_transactionzFlaskClient.session_transaction�s����(�=�	��P���
����&�c�&��7��7�7���!�!�#�+�"5�6�6�6�
�	H�	H��(�5�5�c�3�;�G�G�D�	H�	H�	H�	H�	H�	H�	H�	H�	H�	H�	H����	H�	H�	H�	H��	J��H�I�I�I��
�
�
��!�!�#�#��� �0�0��6�6�	��F�
�	@�	@��!�.�.�s�D�$�?�?�?�	@�	@�	@�	@�	@�	@�	@�	@�	@�	@�	@����	@�	@�	@�	@�	
�*�*��K��&�&�s�+�+�A�.��K���L� � ��.�.�	
�	
�	
�	
�	
s$�!A;�;A?�A?�
C6�6C:�=C:�otherrc�H�i|j�|�}|jr|jj|d<|S)Nzwerkzeug.debug.preserve_context)rVrSrT�append)r2ro�outs   r7�
_copy_environzFlaskClient._copy_environ�s6��,��"�,�e�,��� �	O�59�5G�5N�C�1�2��
r8�tuple[t.Any, ...]�dict[str, t.Any]�BaseRequestc��|�|�di����|d<t|jg|�Ri|��}	|���|���S#|���wxYw)NrV)rsr+rrO�get_request�close)r2rr�builders    r7�_request_from_builder_argsz&FlaskClient._request_from_builder_args�s��"&�!3�!3�F�J�J�~�r�4R�4R�!S�!S��~�� ��!1�C�D�C�C�C�F�C�C��	��&�&�(�(��M�M�O�O�O�O��G�M�M�O�O�O�O���s�A+�+BF��buffered�follow_redirectsr}r)r~rc����|�rAt|dtjjtt
f���rt|dtjj��rKt
|d��}|�|jpi��|_|�	��}n�t|dt��rNt�
|d|j|�i������	��}nKt
|d��}|�|j��|_n|�
||��}|j���t!���|||���}|jj|_|jD]}|j�|���|j���|S)Nr)rrVr|)�
isinstancerF�testr�dictrvrrsrVrx�from_environrOr_r{rUryr0�openr;�json_modulerT�
enter_context�clear)
r2r}r~rrrzr^�response�cmr6s
         �r7r�zFlaskClient.open�s�����	D�J���G�h�m�2�D�+�F�
�
�	D��$�q�'�8�=�#?�@�@�
F��t�A�w�-�-��'+�'9�'9�'�:N�:T�RT�'U�'U��$�!�-�-�/�/����D��G�T�*�*�
F�(�5�5���G��!1��@R�@R�SU�@V�@V�6����+�-�-���
�t�A�w�-�-��"&�"4�"4�W�_�"E�"E�����5�5�d�F�C�C�G�
	
��!�!�#�#�#��7�7�<�<���-� �
�
��
 $�/�4����$�	2�	2�B���-�-�b�1�1�1�1��� � �"�"�"��r8c�@�|jrtd���d|_|S)NzCannot nest client invocationsT)rSrb�r2s r7�	__enter__zFlaskClient.__enter__�s*��� �	A��?�@�@�@� $����r8�exc_type�type | None�	exc_value�BaseException | None�tb�TracebackType | Nonec�F�d|_|j���dS)NF)rSrUry)r2r�r�r�s    r7�__exit__zFlaskClient.__exit__�s'��!&�����!�!�#�#�#�#�#r8)rrrrr r!)rrrrr rW)rorr r)rrtrrur rv)
rrr}r)r~r)rrr r)r rN)r�r�r�r�r�r�r r!)r>r?r@rA�__annotations__r1rrnrsr{r�r�r�rBrCs@r7rNrNms���������������
�
�
�
�
�
��/
�/
�/
��^�/
�b����	�	�	�	��!&�	+�+�+�+�+�+�+�+�Z����$�$�$�$�$�$�$�$r8rNc�4��eZdZdZd�fd�Z	dd�fd
�
Z�xZS)�FlaskCliRunnerz�A :class:`~click.testing.CliRunner` for testing a Flask app's
    CLI commands. Typically created using
    :meth:`~flask.Flask.test_cli_runner`. See :ref:`testing-cli`.
    rrrrr r!c�H��||_t��jdi|��dS)NrK)rr0r1)r2rrr6s   �r7r1zFlaskCliRunner.__init__s-�����������"�"�6�"�"�"�"�"r8N�clirr
c����|��jj}d|vrt�fd����|d<t��j||fi|��S)acInvokes a CLI command in an isolated environment. See
        :meth:`CliRunner.invoke <click.testing.CliRunner.invoke>` for
        full method documentation. See :ref:`testing-cli` for examples.

        If the ``obj`` argument is not given, passes an instance of
        :class:`~flask.cli.ScriptInfo` that knows how to load the Flask
        app being tested.

        :param cli: Command object to invoke. Default is the app's
            :attr:`~flask.app.Flask.cli` group.
        :param args: List of strings to invoke the command with.

        :return: a :class:`~click.testing.Result` object.
        Nr9c����jS)N)rr�s�r7�<lambda>z'FlaskCliRunner.invoke.<locals>.<lambda>(s	���$�(�r8)�
create_app)rr�rr0�invoke)r2r�rrr6s`   �r7r�zFlaskCliRunner.invokesc����"�	��(�,�C����	D�&�2B�2B�2B�2B�C�C�C�F�5�M��u�w�w�~�c�4�2�2�6�2�2�2r8)rrrrr r!)NN)r�rrrrrr r
)r>r?r@rAr1r�rBrCs@r7r�r�	so���������
#�#�#�#�#�#�
04�3�3�3�3�3�3�3�3�3�3�3r8r�)r r)'�
__future__r�importlib.metadatarH�typing�t�
contextlibrrr�typesr�urllib.parser�
werkzeug.testrF�
click.testingr	r
r�werkzeug.wrappersrrvr�r�sessionsr�
TYPE_CHECKING�_typeshed.wsgirrrrr�rrGrLrNr�rKr8r7�<module>r�s���"�"�"�"�"�"���������%�%�%�%�%�%� � � � � � �������������!�!�!�!�!�!�����#�#�#�#�#�#� � � � � � � � � � � � �4�4�4�4�4�4�������"�"�"�"�"�"��?��.�.�.�.�.�.�*�*�*�*�*�*�������C2�C2�C2�C2�C2�X�]�1�C2�C2�C2�L������Y$�Y$�Y$�Y$�Y$�&�Y$�Y$�Y$�x!3�!3�!3�!3�!3�Y�!3�!3�!3�!3�!3r8