ó
P'^c           @@  sr   d  d l  m Z d  d l 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 S(   i    (   t   absolute_importN(   t   count(   t   apply_targett   BasePool(   t   AppCaset   Mockt   test_BasePoolc           B@  sĄ   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 d   Z RS(   c      	   @  s6  i   t  d    d     f d  } t | d d  d d d | d  d	 | d	  |  j i d
 d f d 6d d f d 6   d	 } |  j d | d  |  j | d
 d t j    |  j | d
 d
   j   t | d d  d d d | d  d	 d  |  j	  i d d f d 6d d f d 6 d  S(   Ni    c         @  s        f d   } | S(   Nc          @  s   t     |  f   < S(   N(   t   next(   t   args(   t   countert   namet   retvalt   scratch(    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   callback   s    (    (   R
   R   R   (   R	   R   (   R
   R   sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   gen_callback   s    t   targeti*   R   i   i   R   t   accept_callbacki   i   i   i   (   i   i   (   i   i   (   i*   (   i   i   (   i   i   (   i*   (
   R   t   NoneR   t   assertDictContainsSubsett   assertEqualt   ost   getpidt
   assertTruet   cleart   assertDictEqual(   t   selfR   t   pa1(    (   R	   R   sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_apply_target   s,    

	c         C@  s&   t  d  } t | _ | j t  d  S(   Ni
   (   R   t   Falset   _does_debugt   apply_asynct   object(   R   t   x(    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_does_not_debug2   s    	c         C@  s   |  j  t d  j d  d  S(   Ni   (   R   R   t   num_processes(   R   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_num_processes7   s    c         C@  s   t  d  j   d  S(   Ni
   (   R   t   on_start(   R   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_interface_on_start:   s    c         C@  s   t  d  j   d  S(   Ni
   (   R   t   on_stop(   R   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_interface_on_stop=   s    c         C@  s   t  d  j   d  S(   Ni
   (   R   t   on_apply(   R   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_interface_on_apply@   s    c         C@  s   |  j  t d  j i   d  S(   Ni
   (   R   R   t   info(   R   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_interface_infoC   s    c         C@  s<   t  d  } |  j | j  | j | _ |  j | j  d  S(   Ni
   (   R   t   assertFalset   activet   RUNt   _stateR   (   R   t   p(    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_activeF   s    c         C@  s0   t  d  } |  j t   | j   Wd  QXd  S(   Ni
   (   R   t   assertRaisest   NotImplementedErrort   restart(   R   R0   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_restartL   s    c         C@  s   t  d  } | j   d  S(   Ni
   (   R   t   on_terminate(   R   R0   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_interface_on_terminateQ   s    c         C@  s-   |  j  t   t d  j d  Wd  QXd  S(   Ni
   ie   (   R2   R3   R   t   terminate_job(   R   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_interface_terminate_jobU   s    c         C@  s   |  j  t d  j    d  S(   Ni
   (   R   R   t   did_start_ok(   R   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_interface_did_start_okY   s    c         C@  s#   |  j  t d  j t     d  S(   Ni
   (   t   assertIsNoneR   t   register_with_event_loopR   (   R   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt'   test_interface_register_with_event_loop\   s    c         C@  s#   |  j  t d  j t     d  S(   Ni
   (   R<   R   t   on_soft_timeoutR   (   R   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_interface_on_soft_timeouta   s    c         C@  s#   |  j  t d  j t     d  S(   Ni
   (   R<   R   t   on_hard_timeoutR   (   R   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_interface_on_hard_timeoutd   s    c         C@  sI   t  d  } t   | _ | j   |  j | j | j  | j j   d  S(   Ni
   (   R   R   t   on_closet   closeR   R/   t   CLOSEt   assert_called_with(   R   R0   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_interface_closeg   s
    
c         C@  s   |  j  t d  j    d  S(   Ni
   (   R<   R   RC   (   R   (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   test_interface_no_closen   s    (   t   __name__t
   __module__R   R!   R#   R%   R'   R)   R+   R1   R5   R7   R9   R;   R>   R@   RB   RG   RH   (    (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyR      s"   	%															(   t
   __future__R    R   t	   itertoolsR   t   celery.concurrency.baseR   R   t   celery.tests.caseR   R   R   (    (    (    sK   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/concurrency/test_concurrency.pyt   <module>   s
   