def __init__(self): self.apps = len(Application.cf_api_get_list()) self.service_instances = len(ServiceInstance.cf_api_get_list()) self.services = len(ServiceType.cf_api_get_list()) self.buildpacks = len(Buildpack.cf_api_get_list()) self.orgs = len(Organization.cf_api_get_list()) self.spaces = len(Space.cf_api_get_list()) self.users = len(User.cf_api_get_all_users())
def test_onboarding(context): """Test Onboarding""" step("Onboard new user") test_user, test_org = onboarding.onboard(context, check_email=False) step("Check that user is created") users = User.cf_api_get_all_users() assert test_user in users step("Check that organization is created") org_list = Organization.api_get_list() assert test_org in org_list
logger.info("No database to remove.") if __name__ == "__main__": all_data_sets = DataSet.api_get_list() test_data_sets = [x for x in all_data_sets if is_test_object_name(x.title)] log_deleted_objects(test_data_sets, "data set") fixtures.tear_down_test_objects(test_data_sets) all_transfers = Transfer.api_get_list() test_transfers = [x for x in all_transfers if is_test_object_name(x.title)] log_deleted_objects(test_transfers, "transfer") fixtures.tear_down_test_objects(test_transfers) all_users = User.cf_api_get_all_users() test_users = [x for x in all_users if is_test_object_name(x.username)] log_deleted_objects(test_users, "user") fixtures.tear_down_test_objects(test_users) all_pending_invitations = Invitation.api_get_list() test_invitations = [ x for x in all_pending_invitations if is_test_object_name(x.username) ] log_deleted_objects(test_invitations, "invitation") fixtures.tear_down_test_objects(test_invitations) all_orgs = Organization.cf_api_get_list() test_orgs = [x for x in all_orgs if is_test_object_name(x.name)] log_deleted_objects(test_orgs, "organization") fixtures.tear_down_test_objects(test_orgs, )