ó
ç'ÊUc           @   s|   d  d l  m Z d  d l m Z d  d l m Z m Z d  d l m Z m	 Z	 d e f d „  ƒ  YZ
 d e f d „  ƒ  YZ d	 S(
   iÿÿÿÿ(   t   urlparse(   t   TestCase(   t   Requestt   Response(   t   WrappedRequestt   WrappedResponset   WrappedRequestTestc           B   sk   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z RS(   c         C   s2   t  d d i d d 6ƒ|  _ t |  j ƒ |  _ d  S(   Ns    http://www.example.com/page.htmlt   headerss	   text/htmls   Content-Type(   R   t   requestR   t   wrapped(   t   self(    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   setUp
   s    	c         C   s#   |  j  |  j j ƒ  |  j j ƒ d  S(   N(   t   assertEqualR	   t   get_full_urlR   t   url(   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   test_get_full_url   s    c         C   s,   |  j  |  j j ƒ  t |  j j ƒ j ƒ d  S(   N(   R   R	   t   get_hostR    R   R   t   netloc(   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   test_get_host   s    c         C   s,   |  j  |  j j ƒ  t |  j j ƒ j ƒ d  S(   N(   R   R	   t   get_typeR    R   R   t   scheme(   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   test_get_type   s    c         C   s   |  j  |  j j ƒ  ƒ d  S(   N(   t   assertFalseR	   t   is_unverifiable(   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   test_is_unverifiable   s    c         C   s*   t  |  j j d <|  j |  j j ƒ  ƒ d  S(   NR   (   t   TrueR   t   metat
   assertTrueR	   R   (   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   test_is_unverifiable2   s    c         C   s   |  j  |  j j ƒ  d ƒ d  S(   Ns   www.example.com(   R   R	   t   get_origin_req_host(   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   test_get_origin_req_host   s    c         C   s6   |  j  |  j j d ƒ ƒ |  j |  j j d ƒ ƒ d  S(   Ns   content-typet   xxxxx(   R   R	   t
   has_headerR   (   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   test_has_header"   s    c         C   s?   |  j  |  j j d ƒ d ƒ |  j  |  j j d d ƒ d ƒ d  S(   Ns   content-types	   text/htmlR   t   def(   R   R	   t
   get_header(   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   test_get_header&   s    c         C   s)   |  j  |  j j ƒ  d d g f g ƒ d  S(   Ns   Content-Types	   text/html(   R   R	   t   header_items(   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   test_header_items*   s    c         C   s1   |  j  j d d ƒ |  j |  j j d d ƒ d  S(   Nt   hellot   world(   R	   t   add_unredirected_headerR   R   R   (   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   test_add_unredirected_header-   s    (   t   __name__t
   __module__R   R   R   R   R   R   R   R!   R$   R&   R*   (    (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyR      s   										t   WrappedResponseTestc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s2   t  d d i d d 6ƒ|  _ t |  j ƒ |  _ d  S(   Ns    http://www.example.com/page.htmlR   s	   text/htmls   Content-TYpe(   R   t   responseR   R	   (   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyR   3   s    	c         C   s#   |  j  |  j j ƒ  |  j k ƒ d  S(   N(   t   assert_R	   t   info(   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt	   test_info8   s    c         C   s#   |  j  |  j j d ƒ d g ƒ d  S(   Ns   content-types	   text/html(   R   R	   t
   getheaders(   R
   (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   test_getheaders;   s    (   R+   R,   R   R1   R3   (    (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyR-   1   s   		N(   t   six.moves.urllib.parseR    t   unittestR   t   scrapy.httpR   R   t   scrapy.http.cookiesR   R   R   R-   (    (    (    s;   /home/travis/build/scrapy/scrapy/tests/test_http_cookies.pyt   <module>   s
   )