a
    Zg                     @   sj   d dl Z ddlmZ ddlmZmZmZmZmZ ddl	m
Z
 ddddZddd	d
ZddddZdS )    N   )Request)get_comma_headerhas_expect_100_continueHeadersnormalize_and_validateset_comma_header)LocalProtocolError)returnc                  C   s  t dgdgksJ t dgdgks(J tt t dg W d    n1 sR0    Y  tt t dg W d    n1 s0    Y  tt} t dg W d    n1 s0    Y  dt| jv sJ tt t dg W d    n1 s0    Y  tt t dg W d    n1 s80    Y  tt t d	g W d    n1 sn0    Y  tt} t d
g W d    n1 s0    Y  dt| jv sJ tt t dg W d    n1 s0    Y  tt t dg W d    n1 s$0    Y  tt t dg W d    n1 sZ0    Y  tt t dg W d    n1 s0    Y  tt t dg W d    n1 s0    Y  tt t dg W d    n1 s0    Y  t dgdgksJ tt t dg W d    n1 sH0    Y  tt t dg W d    n1 s~0    Y  tt t ddg W d    n1 s0    Y  t ddgdgksJ t dgdgksJ tt t g d W d    n1 s0    Y  tt t dg W d    n1 sR0    Y  t dgdgksrJ t dgdgksJ tt} t dg W d    n1 s0    Y  | jjd ksJ tt} t ddg W d    n1 s0    Y  | jjd ksJ d S )!N)foobar)   foo   bar)s   foo r   )s    foor   )s   foo bar   bazzfoo bar)s   foo barr   )s   foobarr   )s   foobarr   )r   zbarbazzbar\rbaz)r   zbar
baz)r   zbar baz)r   zbarbaz  )r   z  barbaz)r   zbarbaz	)r   z	barbazContent-Length1)   content-length   1)r   Zasdf)r   Z1xr   2)r   0)r      0)r   z0 , 0)r   r   r   )r   z1 , 1,2)Transfer-Encodingchunked)s   transfer-encodings   chunked)r   ZcHuNkEd)r   gzipi  )r   pytestraisesr	   strvalueZerror_status_hint)excinfo r!   d/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/h11/tests/test_headers.pytest_normalize_and_validate   s    (((************,
$**$r#   c                  C   s   t g d} t| dg dks"J t| dddg} tt  t| dddg W d    n1 sb0    Y  | g dks|J t| d	d
g} | g dksJ d S )N))
Connectionclose)ZwhateverZ	something)Z
connectiONzfOo,, , BAR
   connection)   closer   r      newthingabz  a)r&   r'   )   whatevers	   somethingr&   s   fOo,, , BARr(      ar(      br,   zdifferent thing)r+   r-   r.   r0   )r,   s   different thing)r   r   r   r   r   r	   )headersr!   r!   r"   test_get_set_comma_header_   s    .r3   c                   C   sl   t tddddgdsJ t tdddgdr2J t tddddgdsLJ t tddddgddrhJ d S )	NGET/)Hostzexample.com)Expectz100-continue)methodtargetr2   )r7   z100-Continuez1.0)r8   r9   r2   http_version)r   r   r!   r!   r!   r"   test_has_100_continue   s2    r;   )r   Z_eventsr   _headersr   r   r   r   r   Z_utilr	   r#   r3   r;   r!   r!   r!   r"   <module>   s   Q#