Example #1
0
def test_message_edit_6():
    user1, user_id1, admin1, admin_id1, admin2, admin_id2, channel1, channel2 = setup(
    )
    message_send(admin1, channel1, 'testing')
    message_remove(admin1, 1)
    with pytest.raises(ValueError):
        message_edit(admin1, 1, 'hello world')
Example #2
0
def test_message_remove_2():
    user1, user_id1, admin1, admin_id1, admin2, admin_id2, channel1, channel2 = setup()
    message_send(admin1, channel1, 'test message one')
    message_send(admin1, channel1, 'test message two')
    assert message_remove(admin1, 1) == {}
    assert not is_valid_message(1)
    assert message_remove(admin1, 2) == {}
    assert not is_valid_message(2)
Example #3
0
def test_message_remove_5():
    user1, user_id1, admin1, admin_id1, admin2, admin_id2, channel1, channel2 = setup()
    message_send(user1, channel1, "hey admin, did you hear you can remove other people messages")
    message_send(admin1, channel1, 'yep, let me show you my admin rights')
    assert message_remove(admin1, 1) == {}
    assert not is_valid_message(1)
Example #4
0
def test_message_remove_4():
    user1, user_id1, admin1, admin_id1, admin2, admin_id2, channel1, channel2 = setup()
    message_send(admin1, channel1, "hey admin 2, apparently we can remove each others messages")
    message_send(admin2, channel1, 'that sounds pretty fair to me')
    assert message_remove(admin1, 2) == {}
    assert not is_valid_message(2)
Example #5
0
def test_message_remove_3():
    user1, user_id1, admin1, admin_id1, admin2, admin_id2, channel1, channel2 = setup()
    message_send(admin1, channel1, 'sorry guys only admins can remove other peoples messages')
    message_send(user1, channel1, 'are you joking? let me test that')
    with pytest.raises(AccessError):
        message_remove(user1, 1)
Example #6
0
def test_message_remove_1():
    user1, user_id1, admin1, admin_id1, admin2, admin_id2, channel1, channel2 = setup()
    message_send(admin1, channel1, 'testing 123')
    assert message_remove(admin1, 1) == {}
    assert not is_valid_message(1)
Example #7
0
def test_message_remove_8():
    user1, user_id1, admin1, admin_id1, admin2, admin_id2, channel1, channel2 = setup()
    message_send(admin1, channel1, 'Hello world!')
    with pytest.raises(AccessError):
        message_remove(user1, 1)
Example #8
0
def test_message_remove_7():
    user1, user_id1, admin1, admin_id1, admin2, admin_id2, channel1, channel2 = setup()
    with pytest.raises(ValueError):
        message_remove(admin1, 1)