#NEWLINE# def test_states_retry_reverted_linear_flow( self ) : #NEWLINE# #INDENT# flow = lf . Flow ( 'flow-1' , retry . Times ( 2 , 'r1' , provides = 'x' ) ) . add ( utils . ProgressingTask ( 'task1' ) , utils . ConditionalTask ( 'task2' ) ) #NEWLINE# engine = self . _make_engine ( flow ) #NEWLINE# engine . storage . inject ( { #NEWLINE# #INDENT# 'y' : 4 , #NEWLINE# #UNINDENT# } ) #NEWLINE# with utils . CaptureListener ( engine ) as capturer : #NEWLINE# #INDENT# self . assertRaisesRegexp ( RuntimeError , '^Woot' , engine . run ) #NEWLINE# #UNINDENT# self . assertEqual ( { #NEWLINE# #INDENT# 'y' : 4 , #NEWLINE# #UNINDENT# } , engine . storage . fetch_all ( ) ) #NEWLINE# expected = [ 'flow-1.f RUNNING' , 'r1.r RUNNING' , 'r1.r SUCCESS(1)' , 'task1.t RUNNING' , 'task1.t SUCCESS(5)' , 'task2.t RUNNING' , 'task2.t FAILURE(Failure: RuntimeError: Woot!)' , 'task2.t REVERTING' , 'task2.t REVERTED(None)' , 'task1.t REVERTING' , 'task1.t REVERTED(None)' , 'r1.r RETRYING' , 'task1.t PENDING' , 'task2.t PENDING' , 'r1.r RUNNING' , 'r1.r SUCCESS(2)' , 'task1.t RUNNING' , 'task1.t SUCCESS(5)' , 'task2.t RUNNING' , 'task2.t FAILURE(Failure: RuntimeError: Woot!)' , 'task2.t REVERTING' , 'task2.t REVERTED(None)' , 'task1.t REVERTING' , 'task1.t REVERTED(None)' , 'r1.r REVERTING' , 'r1.r REVERTED(None)' , 'flow-1.f REVERTED' ] #NEWLINE# self . assertEqual ( expected , capturer . values )