#NEWLINE# def test_cancel( self ) : #NEWLINE# #INDENT# self . assertEqual ( self . gator . backend . len ( ALL ) , 0 ) #NEWLINE# task_1 = Task ( async = True ) #NEWLINE# task_2 = Task ( task_id = 'hello' , async = True ) #NEWLINE# self . gator . push ( task , so_computationally_expensive , 1 , 1 ) #NEWLINE# self . gator . push ( task_2 , so_computationally_expensive , 3 , 5 ) #NEWLINE# self . assertEqual ( self . gator . backend . len ( ALL ) , 2 ) #NEWLINE# task = self . gator . cancel ( task_2 . task_id ) #NEWLINE# self . assertEqual ( task . status , CANCELED ) #NEWLINE# self . assertEqual ( self . gator . backend . len ( ALL ) , 1 )