
    h                     p    d dl Z d dlmZmZ  G d de j                        Z G d de j                        Zy)    N)
create_url	parse_urlc                   f    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zy)TestCreateWsUrlc                 :    | j                  t        d      d       y )N	localhostzws://localhost:80/assertEqualr   selfs    f/var/www/Befach/backend/env/lib/python3.12/site-packages/autobahn/websocket/test/test_websocket_url.pytest_create_url01z!TestCreateWsUrl.test_create_url01"   s    K02FG    c                 >    | j                  t        dd      d       y )Nr   i  )portzws://localhost:8090/r	   r   s    r   test_create_url02z!TestCreateWsUrl.test_create_url02%       Kd;=STr   c                 >    | j                  t        dd      d       y )Nr   wspathws://localhost:80/wsr	   r   s    r   test_create_url03z!TestCreateWsUrl.test_create_url03(   r   r   c                 >    | j                  t        dd      d       y )Nr   /wsr   r   r	   r   s    r   test_create_url04z!TestCreateWsUrl.test_create_url04+   s    Ke<>TUr   c                 >    | j                  t        dd      d       y )Nr   z
/ws/foobarr   zws://localhost:80/ws/foobarr	   r   s    r   test_create_url05z!TestCreateWsUrl.test_create_url05.   s    KlCEbcr   c                 >    | j                  t        dd      d       y )Nr   T)isSecurewss://localhost:443/r	   r   s    r   test_create_url06z!TestCreateWsUrl.test_create_url061   s    K$?AWXr   c                 @    | j                  t        ddd      d       y )Nr   T  r    r   r!   r	   r   s    r   test_create_url07z!TestCreateWsUrl.test_create_url074   s    K$SIKabr   c                 @    | j                  t        ddd      d       y )Nr   TP   r%   zwss://localhost:80/r	   r   s    r   test_create_url08z!TestCreateWsUrl.test_create_url087   s    K$RHJ_`r   c           
      H    | j                  t        ddddddi      d       y )	Nr   T#  r   foobarr    r   r   paramszwss://localhost:9090/ws?foo=barr	   r   s    r   test_create_url09z!TestCreateWsUrl.test_create_url09:   s/    K$TPT^cej]kl  oP  	Qr   c           	      `    t        ddddddd      }| j                  |d	k(  xs |d
k(         y )Nr   Tr+   r   r-      )r,   moor.   z&wss://localhost:9090/ws?foo=bar&moo=23z&wss://localhost:9090/ws?moo=23&foo=bar)r   
assertTrue)r   wsurls     r   test_create_url10z!TestCreateWsUrl.test_create_url10=   s8    ;Dt\ajlTmn!II~UV~M~r   c                 >    | j                  t        dd      d       y )Nz	127.0.0.1r   r   zws://127.0.0.1:80/wsr	   r   s    r   test_create_url11z!TestCreateWsUrl.test_create_url11A   r   r   c                 >    | j                  t        dd      d       y )Nz62.146.25.34r   r   zws://62.146.25.34:80/wsr	   r   s    r   test_create_url12z!TestCreateWsUrl.test_create_url12D   s    N>@YZr   c                 >    | j                  t        dd      d       y )Nzsubsub1.sub1.something.comr   r   z%ws://subsub1.sub1.something.com:80/wsr	   r   s    r   test_create_url13z!TestCreateWsUrl.test_create_url13G   s    $@tLNuvr   c                 >    | j                  t        dd      d       y )Nz::1r   r   zws://::1:80/wsr	   r   s    r   test_create_url14z!TestCreateWsUrl.test_create_url14J   s    E57GHr   c                 >    | j                  t        dd      d       y )Nz0:0:0:0:0:0:0:1r   r   zws://0:0:0:0:0:0:0:1:80/wsr	   r   s    r   test_create_url15z!TestCreateWsUrl.test_create_url15M   s    $5DAC_`r   N)__name__
__module____qualname__r   r   r   r   r   r"   r&   r)   r0   r6   r8   r:   r<   r>   r@    r   r   r   r       s\    HUUVdYcaQ@U[wIar   r   c                   `    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zy)TestParseWsUrlc           	      F    | j                  t        d      dddddi f       y )Nzws://localhostFr   r(   /r
   r   r   s    r   test_parse_url01zTestParseWsUrl.test_parse_url01U   s'    #34uk2sTWY[6\]r   c           	      F    | j                  t        d      dddddi f       y )Nzws://localhost:80Fr   r(   rH   rI   r   s    r   test_parse_url02zTestParseWsUrl.test_parse_url02X   s(    #67%bRUWZ\^9_`r   c           	      F    | j                  t        d      dddddi f       y )Nzwss://localhostTr   r$   rH   rI   r   s    r   test_parse_url03zTestParseWsUrl.test_parse_url03[   s(    #45k3PSUXZ\7]^r   c           	      F    | j                  t        d      dddddi f       y )Nzwss://localhost:443Tr   r$   rH   rI   r   s    r   test_parse_url04zTestParseWsUrl.test_parse_url04^   s(    #89D+sTWY\^`;abr   c           	      F    | j                  t        d      dddddi f       y )Nzwss://localhost/wsTr   r$   r   rI   r   s    r   test_parse_url05zTestParseWsUrl.test_parse_url05a   s(    #784cSXZ_ac:der   c           
      L    | j                  t        d      dddddddgif       y )	Nzwss://localhost/ws?foo=barTr   r$   z/ws?foo=barr   r,   r-   rI   r   s    r   test_parse_url06zTestParseWsUrl.test_parse_url06d   sA    #?@4VY[hjorwz  zA  rB  CC  	Dr   c                 P    | j                  t        d      ddddddgdgd	f       y )
Nz!wss://localhost/ws?foo=bar&moo=23Tr   r$   z/ws?foo=bar&moo=23r   23r-   r3   r,   rI   r   s    r   test_parse_url07zTestParseWsUrl.test_parse_url07g   sQ    #FG$P[]`bvx}  IM  HN  X]  W^  @_  J`  	ar   c                 R    | j                  t        d      dddddddgd	gd
f       y )Nz(wss://localhost/ws?foo=bar&moo=23&moo=44Tr   r$   z/ws?foo=bar&moo=23&moo=44r   rV   44r-   rW   rI   r   s    r   test_parse_url08zTestParseWsUrl.test_parse_url08j   sa    #MNQUWbdg  jE  GL  W[  ]a  Vb  lq  kr  Ns  Qt  	ur   c                 :    | j                  t        t        d       y )Nzhttp://localhostassertRaises	Exceptionr   r   s    r   test_parse_url09zTestParseWsUrl.test_parse_url09m   s    )Y0BCr   c                 :    | j                  t        t        d       y )Nzhttps://localhostr]   r   s    r   test_parse_url10zTestParseWsUrl.test_parse_url10p   s    )Y0CDr   c                 :    | j                  t        t        d       y )Nzhttp://localhost:80r]   r   s    r   test_parse_url11zTestParseWsUrl.test_parse_url11s   s    )Y0EFr   c                 :    | j                  t        t        d       y )Nzhttp://localhost#frag1r]   r   s    r   test_parse_url12zTestParseWsUrl.test_parse_url12v   s    )Y0HIr   c                 :    | j                  t        t        d       y )Nzwss://r]   r   s    r   test_parse_url13zTestParseWsUrl.test_parse_url13y   s    )Y9r   c                 :    | j                  t        t        d       y )Nzws://r]   r   s    r   test_parse_url14zTestParseWsUrl.test_parse_url14|   s    )Y8r   N)rA   rB   rC   rJ   rL   rN   rP   rR   rT   rX   r[   r`   rb   rd   rf   rh   rj   rD   r   r   rF   rF   Q   sT    ^a_cfDauDEGJ:9r   rF   )unittestautobahn.websocket.utilr   r   TestCaser   rF   rD   r   r   <module>rn      s4   6  9.ah'' .ab,9X&& ,9r   