HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/h11/tests/__pycache__/test_receivebuffer.cpython-310.pyc
o

���g~
�	@s~ddlZddlmZddlZddlmZddd�Zej�dej	d	d
d�ej	dd
d�ej	ddd�g�dee
ddfdd��ZdS)�N)�Tuple�)�
ReceiveBuffer�returncCs�t�}|rJ�t|�dksJ�t|�dksJ�|d7}|sJ�t|�dks'J�t|�dks/J�t|�dks7J�|�d�dks@J�|sDJ�t|�dksLJ�t|�dksTJ�t|�dks\J�|�d	�dkseJ�t|�dksmJ�|�d	�dusvJ�|rzJ�|d
7}|��dks�J�t|�dks�J�|��dks�J�t|�dks�J�|d
7}|��dus�J�t|�d
ks�J�|d7}|��dus�J�t|�dks�J�|d7}|��dks�J�|��dks�J�|��dus�J�t|�dks�J�|d7}|��}|gd�ks�J�t|�dk�sJ�|��du�sJ�|d7}|��du�sJ�|�d�dk�s#J�|�r(J�|d7}|��gk�s5J�t|�dk�s>J�dS)Nr��123�rs12��3�
s123
456
789
s	123
456
s789
s12
s345

s12
345

s

6789aaa123
s	12
345

s6789aaa123
s123
a: b
foo:bar

trailing)rsa: bsfoo:barstrailings

�dstrailing

s

trailing)r�len�bytes�maybe_extract_at_most�maybe_extract_next_line�maybe_extract_lines)�b�lines�r�G/usr/local/lib/python3.10/dist-packages/h11/tests/test_receivebuffer.py�test_receivebuffer	s\
r�data)sHTTP/1.1 200 OK
�Content-type: text/plain
sConnection: close
s
�	Some body�with_crlf_delimiter)�id)�HTTP/1.1 200 OK
sContent-type: text/plain
�Connection: close
�
r�with_lf_only_delimiter)rrrrr�with_mixed_crlf_and_lfcCsDt�}|D]}||7}q|��}|gd�ksJ�t|�dks J�dS)N)sHTTP/1.1 200 OKsContent-type: text/plainsConnection: closer)rrr)rr�linerrrr�(test_receivebuffer_for_invalid_delimiterWs$
r")rN)�re�typingr�pytest�_receivebufferrr�mark�parametrize�paramrr"rrrr�<module>s,
N�
�
���#