#NEWLINE# @ mock_swf #NEWLINE# def test_poll_for_decision_task_when_one( ) : #NEWLINE# #INDENT# conn = setup_workflow ( ) #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' ] ) #NEWLINE# resp = conn . poll_for_decision_task ( 'test-domain' , 'queue' , identity = 'srv01' ) #NEWLINE# types = [ evt [ 'eventType' ] for evt in resp [ 'events' ] ] #NEWLINE# types . should . equal ( [ 'WorkflowExecutionStarted' , 'DecisionTaskScheduled' , 'DecisionTaskStarted' ] ) #NEWLINE# resp [ 'events' ] [ ( - 1 ) ] [ 'decisionTaskStartedEventAttributes' ] [ 'identity' ] . should . equal ( 'srv01' )