def test_department_adsc(): dep1 = main_utils.add_department('Windows Management', 'Andy') assert_equals(dep1['error'], '') assert_equals(dep1['data'].name, 'Windows Management') deps = main_utils.get_all_departments() assert_equals(deps['error'], '') assert_equals(len(deps['data']), 1) res = main_utils.delete_department(dep1['data'].id,"Andy") assert_equals(res['error'], '') deps = main_utils.get_all_departments() assert_equals(deps['error'], '') assert_equals(len(deps['data']), 0)
def test_team_adsc(): dep1 = main_utils.add_department('Windows Management', 'Andy') dep2 = main_utils.add_department('Database Management', 'Andy') assert_equals(dep1['error'], '') assert_equals(dep1['data'].name, 'Windows Management') deps = main_utils.get_all_departments() assert_equals(deps['error'], '') assert_equals(len(deps['data']), 2) team1 = main_utils.add_team(dep1['data'].id, "Site Administrator for SharePoint", 'Andy') team2 = main_utils.add_team(dep1['data'].id, "Archive Manager", 'Andy') teams = main_utils.get_teams_by_department(dep1['data'].id) assert_equals(teams['error'], '') assert_equals(len(teams['data']), 2) res = main_utils.delete_team(team1['data'].id, "Andy") assert_equals(res['error'], '') teams = main_utils.get_teams_by_department(dep1['data'].id) assert_equals(teams['error'], '') assert_equals(len(teams['data']), 1) res = main_utils.delete_department(dep1['data'].id,"Andy") assert_equals(res['error'], '') res = main_utils.delete_department(dep2['data'].id,"Andy") assert_equals(res['error'], '') deps = main_utils.get_all_departments() assert_equals(deps['error'], '') assert_equals(len(deps['data']), 0)