Exemplo n.º 1
0
def dispatcher(mocker, plugin_actions, request):
    mocker.patch('machine.dispatch.LowLevelSlackClient', autospec=True)
    dispatch_instance = EventDispatcher(plugin_actions, request.param)
    mocker.patch.object(dispatch_instance, '_get_bot_id')
    dispatch_instance._get_bot_id.return_value = '123'
    mocker.patch.object(dispatch_instance, '_get_bot_name')
    dispatch_instance._get_bot_name.return_value = 'superbot'
    dispatch_instance._aliases = request.param
    return dispatch_instance
Exemplo n.º 2
0
def dispatcher(mocker, plugin_actions, request):
    mocker.patch('machine.dispatch.ThreadPool', autospec=True)
    mocker.patch('machine.singletons.SlackClient', autospec=True)
    mocker.patch('machine.singletons.BackgroundScheduler', autospec=True)
    dispatch_instance = EventDispatcher(plugin_actions, request.param)
    mocker.patch.object(dispatch_instance, '_get_bot_id')
    dispatch_instance._get_bot_id.return_value = '123'
    mocker.patch.object(dispatch_instance, '_get_bot_name')
    dispatch_instance._get_bot_name.return_value = 'superbot'
    dispatch_instance._aliases = request.param
    return dispatch_instance