
=\jk  γ               @   s?   d  Z  d d l Z d d l m Z Gd d   d e j  Z d S)z

ι    N)ΪSimpleCookieJarc               @   s4   e  Z d  Z d d   Z d d   Z d d   Z d S)ΪCookieJarTestc             C   sΩ  t    } | j d  |  j | j d  t    } | j d  |  j | j d  t    } | j d  |  j d | j k  t    } | j d  |  j d | j k  |  j d | j k  t    } | j d  |  j | j d  d	  t    } | j d  | j d
  |  j | j d  d  t    } | j d  | j d  |  j | j d  d  t    } | j d  | j d  |  j | j d  d	  |  j | j d  d  |  j | j d  d  d  S)NΪ z4Cookie with no domain should not be added to the jarza=bza=b; domain=.abcz.abcza=b; domain=abcΪabcza=b; c=d; domain=abcza=b; c=dze=f; domain=abcza=b; c=d; e=fze=f; domain=.abcze=f; domain=xyzΪxyzze=fΪ	something)r   ΪaddΪassertFalseΪjarΪ
assertTrueΪassertEqualΪget)ΪselfΪ
cookie_jar© r   ϊJ/tmp/pip-build-jxowagp5/websocket-client/websocket/tests/test_cookiejar.pyΪtestAdd   s<    								zCookieJarTest.testAddc             C   s°  t    } | j d  |  j | j d  t    } | j d  |  j d | j k  t    } | j d  |  j d | j k  |  j d | j k  t    } | j d  |  j | j d  d  t    } | j d  | j d	  |  j | j d  d
  t    } | j d  | j d  |  j | j d  d
  t    } | j d  | j d  |  j | j d  d  |  j | j d  d
  |  j | j d  d  d  S)Nza=bz4Cookie with no domain should not be added to the jarza=b; domain=.abcz.abcza=b; domain=abcr   za=b; c=d; domain=abcza=b; c=dze=f; domain=abcze=fze=f; domain=.abcze=f; domain=xyzr   r   r   )r   Ϊsetr	   r
   r   r   r   )r   r   r   r   r   ΪtestSetF   s6    							zCookieJarTest.testSetc             C   sο   t    } | j d  |  j | j d  d  |  j | j d  d  |  j | j d  d  |  j | j d  d  | j d  |  j | j d  d  |  j | j d  d  |  j | j d  d  |  j | j d  d  d  S)	Nza=b; c=d; domain=abc.comzabc.comza=b; c=dz	x.abc.comz
abc.com.esr   zxabc.comza=b; c=d; domain=.abc.com)r   r   r   r   )r   r   r   r   r   ΪtestGeti   s    	zCookieJarTest.testGetN)Ϊ__name__Ϊ
__module__Ϊ__qualname__r   r   r   r   r   r   r   r      s   '#r   )Ϊ__doc__ZunittestZwebsocket._cookiejarr   ZTestCaser   r   r   r   r   Ϊ<module>   s   