
    wg~              	           d dl Z d dlmZ d dlZddlmZ ddZej                  j                  d ej                  dd	
       ej                  dd
       ej                  dd
      g      dee
   ddfd       Zy)    N)Tuple   )ReceiveBufferreturnc                     t               } | rJ t        |       dk(  sJ t        |       dk(  sJ | dz  } | sJ t        |       dk(  sJ t        |       dk(  sJ t        |       dk(  sJ | j                  d      dk(  sJ | sJ t        |       dk(  sJ t        |       dk(  sJ t        |       dk(  sJ | j                  d	      dk(  sJ t        |       dk(  sJ | j                  d	      J | rJ | d
z  } | j	                         dk(  sJ t        |       dk(  sJ | j	                         dk(  sJ t        |       dk(  sJ | dz  } | j	                         J t        |       dk(  sJ | dz  } | j	                         J t        |       dk(  sJ | dz  } | j	                         dk(  sJ | j	                         dk(  sJ | j	                         J t        |       dk(  sJ | dz  } | j                         }|g dk(  sJ t        |       dk(  sJ | j                         J | dz  } | j                         J | j                  d      dk(  sJ | rJ | dz  } | j                         g k(  sJ t        |       dk(  sJ y )Nr          123   r   s   12      3
   s   123
456
789
s	   123
456
s   789
s   12s   345
s   12345
s   
6789aaa123
s	   12345

s   6789aaa123
s   123
a: b
foo:bar

trailing)r	   s   a: bs   foo:bars   trailings   
d   s   trailing
s
   
trailing)r   lenbytesmaybe_extract_at_mostmaybe_extract_next_linemaybe_extract_lines)bliness     a/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/h11/tests/test_receivebuffer.pytest_receivebufferr   	   s   AL5q6Q;;8s??KAH1q6Q;;8v8v""1%...H1q6Q;;8t8t""2&$...8s??""2&...L5 	A$$&/9998z!!!$$&*4448s??LA$$&...8wOA$$&...8~%%% 	A$$&*::::$$&*;;;;$$&...8s?? 	22A!!#E11118{"""  "***NA  "***""3'+<<<<L5 A  "b(((8{"""r   data)s   HTTP/1.1 200 OK
   Content-type: text/plain
s   Connection: close
s   
	   Some bodywith_crlf_delimiter)id)   HTTP/1.1 200 OK
s   Content-type: text/plain
   Connection: close
   
r   with_lf_only_delimiter)r   r   r   r   r   with_mixed_crlf_and_lfc                     t               }| D ]  }||z  }	 |j                         }|g dk(  sJ t        |      dk(  sJ y )N)s   HTTP/1.1 200 OKs   Content-type: text/plains   Connection: closer   )r   r   r   )r   r   liner   s       r   (test_receivebuffer_for_invalid_delimiterr$   W   s_    H 	A 	T	 !!#E    
 8|###r   )r   N)retypingr   pytest_receivebufferr   r   markparametrizeparamr   r$    r   r   <module>r-      s    	   *K#\ 
 %		
 	 (		
 	 (		
+"F$5< $D $G"F$r   