#NEWLINE# @ mock . patch . object ( TriggerInstancePublisher , 'publish_trigger' , mock . MagicMock ( return_value = True ) ) #NEWLINE# @ mock . patch . object ( WebhooksController , '_is_valid_hook' , mock . MagicMock ( return_value = True ) ) #NEWLINE# @ mock . patch . object ( HooksHolder , 'get_triggers_for_hook' , mock . MagicMock ( return_value = [ DUMMY_TRIGGER ] ) ) #NEWLINE# @ mock . patch ( 'st2common.transport.reactor.TriggerDispatcher.dispatch' ) #NEWLINE# def test_post_with_trace( self , dispatch_mock ) : #NEWLINE# #INDENT# post_resp = self . __do_post ( 'git' , WEBHOOK_1 , expect_errors = False , headers = { #NEWLINE# #INDENT# 'St2-Trace-Tag' : 'tag1' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( post_resp . status_int , http_client . ACCEPTED ) #NEWLINE# self . assertEqual ( dispatch_mock . call_args [ 1 ] [ 'trace_context' ] . trace_tag , 'tag1' )