ó
O'^c           @@  s   d  d l  m Z d  d l m Z m Z m Z d d l m Z m Z d e f d     YZ	 d e	 f d     YZ
 d	 e	 f d
     YZ d S(   i    (   t   absolute_import(   t
   Connectiont   Exchanget   Queuei   (   t   Caset   Mockt
   SimpleBasec           B@  sz   e  Z 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 RS(   c         O@  sP   | } t  | t  s= |  j j } | r= d | | f } q= n  |  j | | |  S(   Ns   %s.%s(   t
   isinstanceR   t	   __class__t   __name__t   _Queue(   t   selft   namet   argst   kwargst   q(    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyR      s    c         O@  s   t     d  S(   N(   t   NotImplementedError(   R   R   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyR
      s    c         C@  s_   |  j  s[ t d d  |  _ |  j j    } | j d  Wd  QX|  j d  d t |  _ n  d  S(   Nt	   transportt   memorys
   amq.directt   no_ack(	   t   abstractR   t
   connectiont   channelt   exchange_declareR   t   Nonet   TrueR   (   R   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyt   setUp   s
    	c         C@  s*   |  j  s& |  j j   |  j j   n  d  S(   N(   R   R   t   closeR   (   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyt   tearDown   s    	c         C@  s   |  j  r d  S|  j d d t } | j i d d 6 |  j | j d d  j i d d 6 |  j | j   | j d d  Wd  QXd  S(   Nt   test_produce__consumeR   t   Simplet   hellot   timeouti   g¹?(	   R   R   R   t   putt   assertEqualt   gett   payloadt   assertRaisest   Empty(   R   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyR   "   s    	&c         C@  są   |  j  r d  S|  j d d t } | j i d d 6 |  j | j   j i d d 6 |  j | j   | j   Wd  QX| j i d d 6 |  j | j	 d t
  j i d d 6 |  j | j   | j	 d t
  Wd  QXd  S(   Nt   test_produce__basic_getR   t
   SimpleSyncR   t   block(   R   R   R   R!   R"   t
   get_nowaitR$   R%   R&   R#   t   False(   R   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyR'   -   s    	 &c         C@  sn   |  j  r d  S|  j d d t } x/ t d  D]! } | j i d | f d 6 q/ W|  j | j   d  d  S(   Nt
   test_clearR   i
   s   SimplePurge%dR   (   R   R   R   t   rangeR!   R"   t   clear(   R   R   t   i(    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyR,   ;   s    	c         C@  sY   |  j  r d  S|  j d  } t   | _ |  j | j   |  | j   | j j   d  S(   Nt   test_enter_exit(   R   R   R   R   t   assertIst	   __enter__t   __exit__t   assert_called_with(   R   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyR0   E   s    	
c         C@  s   |  j  r d  S|  j d d t } x/ t d  D]! } | j i d | f d 6 q/ W|  j | j   d  |  j t |  d  d  S(   NR,   R   i
   s   SimplePurge%dR   (   R   R   R   R-   R!   R"   t   qsizet   len(   R   R   R/   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyt
   test_qsizeO   s    	c         C@  sE   |  j  r d  S|  j j   } |  j d d t d | } | j   d  S(   Nt   test_autocloseR   R   (   R   R   R   R   R   R   (   R   R   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyR8   Z   s
    	c         C@  s|   |  j  r d  S|  j j } t d | f  } t d | f | d  } |  j |  } |  j | j j d |  | j   d  S(   Ns   %s-test.custom.Queues   my.routing.keyi    (	   R   R   R	   R   R   R"   t   consumert   queuesR   (   R   t   nt   exchanget   queueR   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyt   test_custom_Queuea   s    		c         C@  s-   |  j  r d  S|  j d  } |  j |  d  S(   Nt   test_nonzero(   R   R   t
   assertTrue(   R   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyt	   test_booln   s    	(   R	   t
   __module__R   R   R   R
   R   R   R   R'   R,   R0   R7   R8   R>   RA   (    (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyR      s   							
	
			t   test_SimpleQueuec           B@  s    e  Z e Z d    Z d   Z RS(   c         O@  s   |  j  j | |   S(   N(   R   t   SimpleQueue(   R   R   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyR
   x   s    c         C@  s#   |  j  d  } |  j | j  d  S(   Nt   test_is_no_ack(   R   t   assertFalseR   (   R   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyt   test_is_ack{   s    (   R	   RB   R+   R   R
   RG   (    (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyRC   u   s   	t   test_SimpleBufferc           B@  s    e  Z e Z d    Z d   Z RS(   c         O@  s   |  j  j | |   S(   N(   R   t   SimpleBuffer(   R   R   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyR      s    c         C@  s#   |  j  d  } |  j | j  d  S(   NRE   (   R   R@   R   (   R   R   (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyRE      s    (   R	   RB   R+   R   R   RE   (    (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyRH      s   	N(   t
   __future__R    t   kombuR   R   R   t   caseR   R   R   RC   RH   (    (    (    s9   /tmp/pip-unpacked-wheel-UAnTfW/kombu/tests/test_simple.pyt   <module>   s
   m