Ejemplo n.º 1
0
def test_message_unreact_1():
    data, user1, user_id1, user2, user_id2, channel1, channel2 = setup()
    message_send(user1, channel1, 'Testing ureacts on slackr')
    message_react(user1, 1, 1)
    assert message_unreact(user1, 1, 1) == {}
    messagedict = message_dict(1)
    assert len(messagedict['reacts'][0]['u_ids']) == 0
Ejemplo n.º 2
0
def test_message_react_5():
    data, user1, user_id1, user2, user_id2, channel1 = setup()
    message_send(user1, channel1, 'okay try using the same react as me')
    message_send(user2, channel1, 'okay here I go again')
    message_react(user1, 1, 1)
    message_react(user2, 1, 1)
    for messagedict in data['messages']:
        if messagedict['message_id'] == 1:
            assert (messagedict['reacts'][0] == {
                'react_id': 1,
                'u_ids': [101, 102],
                'is_this_user_reacted': True
            })
Ejemplo n.º 3
0
def test_channel_messages_8():
    owner_token, owner_id, u_token, u_id, channel_id, channel_id2 = user_setup(
    )
    messagelist = message_setup()

    list1 = []
    start = 25
    end = 52
    message_react(u_token, 52, 1)
    for i in range(start, end):
        list1.append(messagelist[i])
    assert (channel_messages(owner_token, channel_id, 25) == {
        'messages': list1,
        'start': 25,
        'end': -1
    })
    assert not messagelist[0]['reacts'][0]['is_this_user_reacted']
Ejemplo n.º 4
0
def test_message_react_1():
    data, user1, user_id1, user2, user_id2, channel1 = setup()
    message_send(user1, channel1,
                 'Hey guys they just released reacts on slackr')
    assert message_react(user1, 1, 1) == {}
    messagedict = message_dict(1)
    assert messagedict['reacts'][0] == {
        'react_id': 1,
        'u_ids': [101],
        'is_this_user_reacted': True
    }
Ejemplo n.º 5
0
def test_message_react_4():
    data, user1, user_id1, user2, user_id2, channel1 = setup()
    message_send(user1, channel1, 'reacting to self twice')
    message_react(user1, 1, 1)
    with pytest.raises(ValueError):
        message_react(user1, 1, 1)
Ejemplo n.º 6
0
def test_message_react_3():
    data, user1, user_id1, user2, user_id2, channel1 = setup()
    with pytest.raises(ValueError):
        message_react(user1, 1, 1)
Ejemplo n.º 7
0
def test_message_react_2():
    data, user1, user_id1, user2, user_id2, channel1 = setup()
    message_send(user1, channel1,
                 'I wonder what happens if I react with react 2')
    with pytest.raises(ValueError):
        message_react(user1, 1, 2)
Ejemplo n.º 8
0
def test_message_unreact_2():
    data, user1, user_id1, user2, user_id2, channel1, channel2 = setup()
    message_send(user1, channel1, 'Unreacting with reacts that do not exist')
    message_react(user1, 1, 1)
    with pytest.raises(ValueError):
        message_unreact(user1, 1, 2)