Ë
    #ïàj{
  ã                   ó:  — d 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m	Z	 ddl
mZmZmZmZmZ ej                   d„ «       Zej                   d„ «       Zej                   d	„ «       Zej                   d
„ «       Zej                   d„ «       Zej                   d„ «       Zd„ Zy)zŽPytest configuration module.

Contains fixtures, which are tightly bound to the Cheroot framework
itself, useless for end-users' app testing.
é    Né   ©ÚIS_MACOSÚ
IS_WINDOWS)ÚGatewayÚ
HTTPServer)Úget_server_clientÚnative_serverÚthread_and_native_serverÚthread_and_wsgi_serverÚwsgi_serverc                  ó6   — d} t         r| dz  } t        r| dz  } | S )z<Return a common HTTP request timeout for tests with queries.g      à?r   é
   r   )Úcomputed_timeouts    úD/srv/dav/.venv/lib/python3.12/site-packages/cheroot/test/conftest.pyÚhttp_request_timeoutr      s,   € ð ÐåØ˜AÑÐåØ˜BÑÐàÐó    c                 ó   — | \  }}|S )z^Set up and tear down a Cheroot WSGI server instance.

    This exposes the server thread.
    © )r   Úserver_threadÚ_srvs      r   Úwsgi_server_threadr   %   s   € ð 1Ñ€M�4ØÐr   c                 ó   — | \  }}|S )z^Set up and tear down a Cheroot HTTP server instance.

    This exposes the server thread.
    r   )r   r   r   s      r   Únative_server_threadr   0   s   € ð 3Ñ€M�4ØÐr   c                 ó   — t        | «      S )z.Create a test client out of given WSGI server.©r	   )r   s    r   Úwsgi_server_clientr   ;   s   € ô ˜[Ó)Ð)r   c                 ó   — t        | «      S )z.Create a test client out of given HTTP server.r   )r
   s    r   Únative_server_clientr   B   s   € ô ˜]Ó+Ð+r   c               #   ó¬   K  — d„ } t         | «       «      }t        |«       |–— 	 	 t        |«      }|�|j                  «        Œ# t        $ r Y yw xY w­w)z(Provision a server creator as a fixture.c               3   ó@   K  — d –—} | €y t        | «      }|–— |–— y ­w)N)Úmake_http_server©Ú	bind_addrÚ
httpservers     r   Ú	start_srvzhttp_server.<locals>.start_srvM   s*   è ø€ Úˆ	ØÐØÜ% iÓ0ˆ
ØÒØÓùs   ‚N)ÚiterÚnextÚstopÚStopIteration)r&   Úsrv_creatorr%   s      r   Úhttp_serverr,   I   sa   è ø€ òô ‘y“{Ó#€KÜˆÔØ
ÒðØÜ˜kÓ*ˆJØÐ%Ø—‘Ô!ð øô ò Ùðüs"   ‚#A¦A Á	AÁAÁAÁAc                 óà   — t        | t        ¬«      }t        j                  |j                  ¬«      j                  «        |j                  s"t        j                  d«       |j                  sŒ"|S )z7Create and start an HTTP server bound to ``bind_addr``.)r$   Úgateway)Útargetgš™™™™™¹?)	r   r   Ú	threadingÚThreadÚ
safe_startÚstartÚreadyÚtimeÚsleepr#   s     r   r"   r"   a   sX   € äØÜô€Jô
 ×Ñ˜J×1Ñ1Ô2×8Ñ8Ô:à×ÒÜ�
‰
�3Œð ×Óð Ðr   )Ú__doc__r0   r5   ÚpytestÚ_compatr   r   Úserverr   r   Útestingr	   r
   r   r   r   Úfixturer   r   r   r   r   r,   r"   r   r   r   ú<module>r=      sº   ðñó Û ã ç *ß (÷õ ð ‡�ñ
ó ð
ð ‡�ñó ðð ‡�ñó ðð ‡�ñ*ó ð*ð
 ‡�ñ,ó ð,ð
 ‡�ñó ðó.r   