#NEWLINE# def test_zcancelTask( self ) : #NEWLINE# #INDENT# time . sleep ( 2 ) #NEWLINE# tasks = self . worker . tasks ( ) #NEWLINE# for task in tasks : #NEWLINE# #INDENT# self . worker . cancel ( task ) #NEWLINE# #UNINDENT# time . sleep ( 3 ) #NEWLINE# new_tasks = self . worker . tasks ( ) #NEWLINE# real_tasks = [ ] #NEWLINE# for task in tasks : #NEWLINE# #INDENT# if ( task . status not in [ 'cancelled' , 'error' , 'killed' ] ) : #NEWLINE# #INDENT# real_tasks . append ( task ) #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( len ( real_tasks ) , 0 )