def test_update_a_team(): ac = AccessControlAPI() parent_team_full_name = "/CxServer" team_name = "avengers_team" team_id = ac.get_team_id_by_full_name(full_name=parent_team_full_name + "/" + team_name) parent_id = ac.get_team_id_by_full_name(full_name=parent_team_full_name) is_successful = ac.update_a_team(team_id=team_id, name=team_name, parent_id=parent_id) assert is_successful is True
def test_create_new_team(): ac = AccessControlAPI() parent_team_full_name = "/CxServer" team_name = "avengers_team" team_id = ac.get_team_id_by_full_name(full_name=parent_team_full_name + "/" + team_name) parent_id = ac.get_team_id_by_full_name(full_name=parent_team_full_name) if not team_id and parent_id: is_successful = ac.create_new_team(name=team_name, parent_id=parent_id) assert is_successful is True
def test_delete_a_member_from_a_team(): ac = AccessControlAPI() team_id = ac.get_team_id_by_full_name("/CxServer") user_id = 7 is_successful = ac.delete_a_member_from_a_team(team_id=team_id, user_id=user_id) assert is_successful is True
def test_update_members_by_team_id(): ac = AccessControlAPI() team_id = ac.get_team_id_by_full_name("/CxServer") user_ids = [1008, 1007] is_successful = ac.update_members_by_team_id(team_id=team_id, user_ids=user_ids) assert is_successful is True
def test_get_team_by_id(): ac = AccessControlAPI() team_id = ac.get_team_id_by_full_name("/CxServer") team = ac.get_team_by_id(team_id=team_id) assert team is not None
def test_get_team_by_id(): ac = AccessControlAPI() team_id = ac.get_team_id_by_full_name("/CxServer/SP/Company/AllStarTeam") team = ac.get_team_by_id(team_id=team_id) assert team is not None
def test_add_a_user_to_a_team(): ac = AccessControlAPI() team_id = ac.get_team_id_by_full_name("/CxServer") user_id = 7 is_successful = ac.add_a_user_to_a_team(team_id=team_id, user_id=user_id) assert is_successful is True
def test_delete_a_team(): ac = AccessControlAPI() parent_team_full_name = "/CxServer/SP/Company" team_name = "avengers_team" team_id = ac.get_team_id_by_full_name(full_name=parent_team_full_name + "/" + team_name) is_successful = ac.delete_a_team(team_id=team_id) assert is_successful is True
def test_get_members_by_team_id(): ac = AccessControlAPI() team_id = ac.get_team_id_by_full_name("/CxServer") resp = ac.get_members_by_team_id(team_id=team_id) assert resp is not None