예제 #1
0
def test_evaluate_changes_member_shouldnt_have_this_role_but_has():
    member_id = 1
    member_roles = [222, 333, 444]

    role_id = 222
    role_members_ids = [2, 3, 4]

    assert evaluate_changes(member_id, member_roles, role_members_ids,
                            role_id) == [(1, 'remove', 222)]
예제 #2
0
def test_evaluate_changes_member_should_have_this_role_but_doesnt():
    member_id = 1
    member_roles = [333, 444]

    role_id = 222
    role_members_ids = [1, 2, 3, 4]

    assert evaluate_changes(member_id, member_roles, role_members_ids,
                            role_id) == [(1, 'add', 222)]
예제 #3
0
def test_evaluate_changes_member_shouldnt_have_this_role_and_doesnt():
    member_id = 1
    member_roles = [333, 444]

    role_id = 222
    role_members_ids = [2, 3, 4]

    assert evaluate_changes(member_id, member_roles, role_members_ids,
                            role_id) == []
예제 #4
0
def test_evaluate_changes_member_should_have_this_role_and_already_has():
    member_id = 1
    member_roles = [222, 333, 444]

    role_id = 222
    role_members_ids = [1, 2, 3, 4]

    assert evaluate_changes(member_id, member_roles, role_members_ids,
                            role_id) == []