o
    hS                     @   s,   d dl Z ddlT dd Zdd Zdd	 ZdS )
    N   )*c                  C   sh  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 s)w   Y  tt t dg W d    n1 sCw   Y  tt} t dg W d    n1 s]w   Y  dt| jv skJ tt t dg W d    n1 sw   Y  tt} t dg W d    n1 sw   Y  d	t| jv sJ tt t d
g W d    n1 sw   Y  tt t dg W d    n1 sw   Y  tt t dg W d    n1 sw   Y  t dgdgksJ tt t dg W d    n	1 sw   Y  tt t dg W d    n	1 s2w   Y  tt t ddg W d    n	1 sNw   Y  t dgdgks^J t dgdgksiJ tt} t dg W d    n	1 sw   Y  | jjdksJ tt} t ddg W d    n	1 sw   Y  | jjdksJ d S )N)foobar)   foo   bar)s   foo r   )s    foor   )s   foo bar   bazzfoo bar)s   foo barr   )r   zbarbazzbar\rbaz)r   zbar
baz)r   zbar baz)r   z
  barbaz  )Content-Length1)s   content-length   1)r	   Zasdf)r	   Z1x)r	   2)Transfer-Encodingchunked)s   transfer-encodings   chunked)r   ZcHuNkEd)r   gzipi  )normalize_and_validatepytestraisesLocalProtocolErrorstrvalueZerror_status_hint)excinfo r   ^/var/www/html/magazine_api/magazine_env/lib/python3.10/site-packages/h11/tests/test_headers.pytest_normalize_and_validate   sx   


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 s1w   Y  | g dks>J t| d	d
g | g dksMJ 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$   r&   )r"   s   different thing)r   Zget_comma_headerZset_comma_headerr   r   r   )headersr   r   r   test_get_set_comma_header>   s   r)   c                  C   sx   ddl m}  t| ddddgdsJ t| dddgdrJ t| ddddgds,J t| ddddgd	d
r:J d S )Nr   RequestGET/)Hostzexample.com)Expectz100-continue)methodtargetr(   )r/   z100-Continuez1.0)r0   r1   r(   http_version)Z_eventsr+   Zhas_expect_100_continuer*   r   r   r   test_has_100_continue_   s,   r3   )r   _headersr   r)   r3   r   r   r   r   <module>   s
    9!