def test_output():
 rtmbot = init_rtmbot()
 slackclient_mock = create_autospec(SlackClient)
 server_mock = create_autospec(_server.Server)
 slackclient_mock.server = server_mock
 searchlist_mock = create_autospec(_util.SearchList)
 server_mock.channels = searchlist_mock
 channel_mock = create_autospec(_channel.Channel)
 slackclient_mock.server.channels.find.return_value = channel_mock
 rtmbot.slack_client = slackclient_mock
 plugin_mock = create_autospec(Plugin)
 plugin_mock.do_output.return_value = [['C12345678', 'test message']]
 rtmbot.bot_plugins.append(plugin_mock)
 rtmbot.output()
 channel_mock.send_message.assert_called_with('test message')
 channel_mock.reset_mock()
 plugin_mock.reset_mock()
 plugin_mock.do_output.return_value = [['C12345678', '\xf0\x9f\x9a\x80 testing']]
 rtmbot.output()
 channel_mock.send_message.assert_called_with('\xf0\x9f\x9a\x80 testing')
 channel_mock.reset_mock()
 plugin_mock.reset_mock()
 plugin_mock.do_output.return_value = [['C12345678', '\xc3\xb9 h\xc5\x93\xc3\xb83\xc3\xb6']]
 rtmbot.output()
 channel_mock.send_message.assert_called_with('\xc3\xb9 h\xc5\x93\xc3\xb83\xc3\xb6')

def test_output ( ) : rtmbot = init_rtmbot ( ) slackclient_mock = create_autospec ( SlackClient ) server_mock = create_autospec ( _server . Server ) slackclient_mock . server = server_mock searchlist_mock = create_autospec ( _util . SearchList ) server_mock . channels = searchlist_mock channel_mock = create_autospec ( _channel . Channel ) slackclient_mock . server . channels . find . return_value = channel_mock rtmbot . slack_client = slackclient_mock plugin_mock = create_autospec ( Plugin ) plugin_mock . do_output . return_value = [ [ 'C12345678' , 'test message' ] ] rtmbot . bot_plugins . append ( plugin_mock ) rtmbot . output ( ) channel_mock . send_message . assert_called_with ( 'test message' ) channel_mock . reset_mock ( ) plugin_mock . reset_mock ( ) plugin_mock . do_output . return_value = [ [ 'C12345678' , '\xf0\x9f\x9a\x80 testing' ] ] rtmbot . output ( ) channel_mock . send_message . assert_called_with ( '\xf0\x9f\x9a\x80 testing' ) channel_mock . reset_mock ( ) plugin_mock . reset_mock ( ) plugin_mock . do_output . return_value = [ [ 'C12345678' , '\xc3\xb9 h\xc5\x93\xc3\xb83\xc3\xb6' ] ] rtmbot . output ( ) channel_mock . send_message . assert_called_with ( '\xc3\xb9 h\xc5\x93\xc3\xb83\xc3\xb6' )
test that sending a message behaves as expected .