#NEWLINE# @ mock_swf #NEWLINE# def test_respond_decision_task_completed_with_fail_workflow_execution( ) : #NEWLINE# #INDENT# conn = setup_workflow ( ) #NEWLINE# resp = conn . poll_for_decision_task ( 'test-domain' , 'queue' ) #NEWLINE# task_token = resp [ 'taskToken' ] #NEWLINE# decisions = [ { #NEWLINE# #INDENT# 'decisionType' : 'FailWorkflowExecution' , #NEWLINE# 'failWorkflowExecutionDecisionAttributes' : { #NEWLINE# #INDENT# 'reason' : 'my rules' , #NEWLINE# 'details' : 'foo' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] #NEWLINE# resp = conn . respond_decision_task_completed ( task_token , decisions = decisions ) #NEWLINE# resp . should . be . none #NEWLINE# resp = conn . get_workflow_execution_history ( 'test-domain' , conn . run_id , 'uid-abcd1234' ) #NEWLINE# types = [ evt [ 'eventType' ] for evt in resp [ 'events' ] ] #NEWLINE# types . should . equal ( [ 'WorkflowExecutionStarted' , 'DecisionTaskScheduled' , 'DecisionTaskStarted' , 'DecisionTaskCompleted' , 'WorkflowExecutionFailed' ] ) #NEWLINE# attrs = resp [ 'events' ] [ ( - 1 ) ] [ 'workflowExecutionFailedEventAttributes' ] #NEWLINE# attrs [ 'reason' ] . should . equal ( 'my rules' ) #NEWLINE# attrs [ 'details' ] . should . equal ( 'foo' )