def test_addGroupAliases_cas_Normal(test_config):
    GroupService.addGroupAliases(test_config['groupname'],
                                 test_config['groupalias'])
    group = GroupService.getGroup(test_config['groupname'])
    assert test_config['groupalias'] in group.aliases
def test_addGroupAliases_cas_groupe_existant(test_config):
    with pytest.raises(ServiceException):
        GroupService.addGroupAliases(test_config['groupname'],
                                     test_config['groupalias'])
Пример #3
0
    try:
        if not args['email']:
            raise Exception("Argument 'email' manquant")
        GroupService.deleteGroup(args['email'])
    except Exception as err:
        print("Echec d'exécution : {}".format(repr(err)))
        sys.exit(2)
    print("Groupe {} supprimé".format(args['email']))

elif args['addGroupAlias']:
    try:
        if not args['email']:
            raise Exception("Argument 'email' manquant")
        if not args['alias']:
            raise Exception("Argument 'alias' manquant")
        GroupService.addGroupAliases(args['email'], args['alias'])
        group = GroupService.getGroup(args['email'], full_info=True)
    except Exception as err:
        print("Echec d'exécution : {}".format(repr(err)))
        sys.exit(2)
    print(group.showAttr())

elif args['removeGroupAlias']:
    try:
        if not args['email']:
            raise Exception("Argument 'email' manquant")
        if not args['alias']:
            raise Exception("Argument 'alias' manquant")
        GroupService.removeGroupAliases(args['email'], args['alias'])
        group = GroupService.getGroup(args['email'], full_info=True)
    except Exception as err: