ó
P'—^c           @@  sP   d  d l  m Z d  d l m Z m Z d  d l m Z d e f d „  ƒ  YZ d S(   i    (   t   absolute_import(   t   AbortableTaskt   AbortableAsyncResult(   t   AppCaset   test_AbortableTaskc           B@  s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C@  s1   |  j  j d t d t ƒ d „  ƒ } | |  _ d  S(   Nt   baset   sharedc           S@  s   t  S(   N(   t   True(    (    (    sE   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/contrib/test_abortable.pyt	   abortable   s    (   t   appt   taskR   t   FalseR   (   t   selfR   (    (    sE   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/contrib/test_abortable.pyt   setup	   s    $c         C@  s8   |  j  j ƒ  } | j } |  j |  j  j | ƒ t ƒ d  S(   N(   R   t   apply_asynct   idt   assertIsInstancet   AsyncResultR   (   R   t   resultt   tid(    (    sE   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/contrib/test_abortable.pyt   test_async_result_is_abortable   s    	c         C@  sZ   |  j  j ƒ  z8 |  j  j ƒ  } | j } |  j |  j  j d | ƒ ƒ Wd  |  j  j ƒ  Xd  S(   Nt   task_id(   R   t   push_requestR   R   t   assertFalset
   is_abortedt   pop_request(   R   R   R   (    (    sE   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/contrib/test_abortable.pyt   test_is_not_aborted   s    	 c         C@  s]   |  j  j |  j _ |  j j ƒ  z) d |  j j _ |  j |  j j ƒ  ƒ Wd  |  j j ƒ  Xd  S(   Nt   foo(	   R	   R   R   R   t   requestR   R   R   R   (   R   (    (    sE   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/contrib/test_abortable.pyt    test_is_aborted_not_abort_result    s    c         C@  sd   |  j  j ƒ  zB |  j  j ƒ  } | j ƒ  | j } |  j |  j  j d | ƒ ƒ Wd  |  j  j ƒ  Xd  S(   NR   (   R   R   R   t   abortR   t
   assertTrueR   R   (   R   R   R   (    (    sE   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/contrib/test_abortable.pyt   test_abort_yields_aborted)   s    
	 (   t   __name__t
   __module__R   R   R   R   R    (    (    (    sE   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/contrib/test_abortable.pyR      s
   						N(   t
   __future__R    t   celery.contrib.abortableR   R   t   celery.tests.caseR   R   (    (    (    sE   /tmp/pip-unpacked-wheel-gV1wwp/celery/tests/contrib/test_abortable.pyt   <module>   s   