
    Mh                         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mZmZ  G d d	e          ZdS )
    N)HTTP1Connection)HTTPMessageDelegate)IOStream)Event)add_accept_handler)AsyncTestCasebind_unused_portgen_testc                   N     e Zd ZdZ fdZed             Zed             Z xZS )HTTP1ConnectionTestNc                 p    t                                                       |                                  d S N)supersetUp
asyncSetUp)self	__class__s    a/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/tornado/test/http1connection_test.pyr   zHTTP1ConnectionTest.setUp   s*        c              #      K   t                      \  }}t                       fd}t          ||           t          t	          j                               _                              j        j                    j                            d|f          	                                gV   j
                            |           |                                 d S )Nc                     t          |           _                            j        j                                                    d S r   )r   server_stream
addCleanupcloseset)connaddreventr   s     r   accept_callbackz7HTTP1ConnectionTest.asyncSetUp.<locals>.accept_callback   s:    !)$DOOD.4555IIKKKKKr   z	127.0.0.1)r	   r   r   r   socketclient_streamr   r   connectwaitio_loopremove_handler)r   listenerportr   r   s   `   @r   r   zHTTP1ConnectionTest.asyncSetUp   s      )++$	 	 	 	 	 	
 	8_555%fmoo66*0111!));*=>>

MMMM##H---r   c              #     K   t          | j        d          }| j                            d           | j                                         t                      | g  G fddt                    }|                     |                      V                                  V  | 	                    | j
        d           | 	                    d                              d           d S )NTs"   HTTP/1.0 200 Not Modified

helloc                   .    e Zd ZfdZ fdZfdZdS )CHTTP1ConnectionTest.test_http10_no_content_length.<locals>.Delegatec                      |j         _         d S r   )code)r   
start_lineheaderstests      r   headers_receivedzTHTTP1ConnectionTest.test_http10_no_content_length.<locals>.Delegate.headers_received1   s    &O			r   c                 2                         |           d S r   )append)r   databodys     r   data_receivedzQHTTP1ConnectionTest.test_http10_no_content_length.<locals>.Delegate.data_received4   s    D!!!!!r   c                 0                                      d S r   )r   )r   r   s    r   finishzJHTTP1ConnectionTest.test_http10_no_content_length.<locals>.Delegate.finish7   s    		r   N)__name__
__module____qualname__r0   r5   r7   )r4   r   r/   s   r   Delegater*   0   s`        , , , , ," " " " "      r   r;      r   s   hello)r   r!   r   writer   r   r   read_responser#   assertEqualr,   join)r   r   r;   r4   r   r/   s      @@@r   test_http10_no_content_lengthz1HTTP1ConnectionTest.test_http10_no_content_length$   s      t1488  !JKKK  """	 	 	 	 	 	 	 	 	* 	 	 	   ,,,,,jjllC((($22222r   )	r8   r9   r:   r,   r   r
   r   rA   __classcell__)r   s   @r   r   r      ss        D       X  3 3 X3 3 3 3 3r   r   )r    typingtornado.http1connectionr   tornado.httputilr   tornado.iostreamr   tornado.locksr   tornado.netutilr   tornado.testingr   r	   r
   r    r   r   <module>rK      s      3 3 3 3 3 3 0 0 0 0 0 0 % % % % % %       . . . . . . E E E E E E E E E E13 13 13 13 13- 13 13 13 13 13r   