    def test_handle_messages_command(self):
        '''Test receiving a command.'''
        self.bot.commands = {'test': None}
        self.bot.handle_command = Mock()
        self.bot.chat.get_messages.return_value = [{'type': 'message',
                                                    'user': 'id',
                                                    'channel': 'D12345',
                                                    'text': 'test command'}]
        self.bot.handle_messages()
        self.bot.handle_command.assert_called_with(self.bot.users['id'], 'test command')
Test receiving a command.
tests/bot_test.py