Exemplo n.º 1
0
def create_account(name):
    account = AccountService.getAccount(name)
    if account == None:
        AccountService.createAccount(name, "{ssha}BIDON")
Exemplo n.º 2
0
def test_createAccount_cas_compteExistant(test_config):
    with pytest.raises(ServiceException):
        AccountService.createAccount(test_config['accountname'], "{ssha}BIDON")
Exemplo n.º 3
0
        sys.exit(2)

    print("Le compte %s a été créé" % nAccount.name)
    print(nAccount.showAttr())

elif args['createAccount'] == True:

    if not args['email']:
        raise Exception("Missing 'email' argument")

    if not args['userPassword']:
        raise Exception("Missing 'userPassword' argument")

    try:
        AccountService.createAccount(name=args['email'],
                                     userPassword=args['userPassword'],
                                     cosId=args['cosId'])

    except Exception as err:
        print("Echec d'exécution : %s" % err)
        sys.exit(2)

    print("Le compte %s a été créé" % args['email'])

elif args['modifyAccount'] == True:

    if not args['email']:
        raise Exception("Missing 'email' argument")

    if not args['jsonData']:
        raise Exception("Missing 'jsonData' argument")
Exemplo n.º 4
0
def test_createAccount_cas_normal(test_config):
    AccountService.createAccount(test_config['accountname'], "{ssha}BIDON")
    account = AccountService.getAccount(test_config['accountname'])
    assert account.name == test_config['accountname']