print 'Team fetch succeeded'

print 'Now trying to edit team ', team_name
res = sdclient.edit_team(team_name,
                         description='Nextgen2',
                         users=['*****@*****.**', '*****@*****.**'])
if res[0] == False:
    print 'Could not edit team ', res[1]
else:
    print 'Edited team to change description and add users'

print 'Now trying to edit user ', user_name
res = sdclient.edit_user(user_name,
                         firstName='Just',
                         lastName='Edited3',
                         teams=[team_name],
                         roles=['ROLE_CUSTOMER', 'ROLE_USER'])
if res[0] == False:
    print 'Could not edit user: '******'Edit user succeeded'

print 'Now trying to delete the team ', team_name
res = sdclient.delete_team(team_name)
if res[0] == False:
    print 'Could not delete team: ', res[1]
else:
    print 'Delete team succeeded'

sys.exit(0)
        print(('-- User ', userA, ' should not be part of team ', teamB, '!', 'Exiting.'))
        sys.exit(1)
    elif admin not in list(res.keys()):
        print(('-- User ', admin, ' should be always part of all teams!', 'Exiting.'))
        sys.exit(1)

finally:
    #
    # Clean-up
    #
    print('Cleaning up...')

    print('-- Deleting test teams.')

    try:
        ok, res = sdclient.delete_team(teamA)
        if not ok:
            print(('-- Team \'', teamA, '\' deletion failed: ', res))
    except Exception as exception:
        print(('-- Team \'', teamA, '\' deletion failed: ', exception))

    try:
        ok, res = sdclient.delete_team(teamB)
        if not ok:
            print(('-- Team \'', teamB, '\' deletion failed: ', res))
    except Exception as exception:
        print(('-- Team \'', teamB, '\' deletion failed: ', exception))

    print('-- Deleting test users.')

    try: