Ejemplo n.º 1
0
    def test_start_poll_status_not_is_started_not_is_music_upload(self, mocked_user_msg):
        poll = Mock()

        poll.is_started = False
        poll.is_music_upload = False

        start_poll_status(None, poll, None)
        assert mocked_user_msg.called
Ejemplo n.º 2
0
def handle_commands(client: WebClient, poll: Poll, request_form: dict) -> None:
    """
    Function, that will handle all the commands that is going to be sent to the bot.
    """
    command = request_form.get('command')

    if command == '/disco':
        start_disco(client, poll, request_form)
    elif command == '/lightsoff':
        start_lightsoff(client, poll, request_form)
    elif command == '/poptop':
        start_poptop(client, poll, request_form)
    elif command == '/top':
        start_top(client, poll, request_form)
    elif command == '/poll_status':
        start_poll_status(client, poll, request_form)
    elif command == '/settings':
        start_settings(client, poll, request_form)
    elif command == '/drop':
        start_drop(client, poll, request_form)
    elif command == '/resume':
        start_resume(client, poll, request_form)
def test_start_poll_status_is_started_is_music_upload(mocker, mocked_started_poll):
    mocked_send_to_usr = mocker.patch('handlers.commands.poll_status.send_msg_to_user')

    start_poll_status(None, mocked_started_poll, None)

    assert mocked_send_to_usr.called