#NEWLINE# @ patch ( 'slacker_cli.requests' ) #NEWLINE# def test_post_message_as_slackbot( self , mock_requests ) : #NEWLINE# #INDENT# token = 'aaa' #NEWLINE# channel = '#channel_name' #NEWLINE# message = 'message string' #NEWLINE# sender_name = None #NEWLINE# as_user = False #NEWLINE# sender_icon = None #NEWLINE# as_slackbot = True #NEWLINE# team = 'team-name' #NEWLINE# try : #NEWLINE# #INDENT# post_message ( token , channel , message , message , as_user , sender_icon , as_slackbot , team ) #NEWLINE# #UNINDENT# except SlackerCliError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# url = 'https://team-name.slack.com/services/hooks/slackbot' #NEWLINE# url += '?token=aaa&channel=%23channel_name' #NEWLINE# mock_requests . post . assert_called_with ( url , message )