Exemplo n.º 1
0
    def check_accounts(self, test_accounts):
        db_identities = list_identities()
        for account in test_accounts:
            # check existence
            db_account = get_account(account=account['account'])
            assert_equal(db_account['account'], account['account'])

            # check properties
            email = account.get('email')
            if email:
                assert_equal(db_account['email'], account['email'])

            # check identities
            identities = account.get('identities')
            if identities:
                for identity in identities:
                    # check identity creation and identity-account association
                    identity_type = IdentityType.from_sym(identity['type'])
                    identity = identity['identity']
                    assert_in((identity, identity_type), db_identities)
                    accounts_for_identity = list_accounts_for_identity(
                        identity, identity_type)
                    assert_in(account['account'], accounts_for_identity)

        # check removal of account
        account = get_account(self.old_account_1)
        assert_equal(account['status'], AccountStatus.DELETED)

        # check removal of identities
        accounts_for_identity = list_accounts_for_identity(
            self.identity_to_be_removed, IdentityType.X509)
        assert_true(account['account'] not in accounts_for_identity)
Exemplo n.º 2
0
def get_account_info(account):
    """
    Returns the info like the statistics information associated to an account_core.

    :param account: The account name.
    :returns: A list with all account information.
    """
    return account_core.get_account(account)
Exemplo n.º 3
0
def get_account_info(account):
    """
    Returns the info like the statistics information associated to an account_core.

    :param account: The account name.
    :returns: A list with all account information.
    """
    return account_core.get_account(account)
Exemplo n.º 4
0
def get_account_info(account, vo='def'):
    """
    Returns the info like the statistics information associated to an account_core.

    :param account: The account name.
    :returns: A list with all account information.
    :param vo: The VO to act on.
    """

    account = InternalAccount(account, vo=vo)

    acc = account_core.get_account(account)
    acc.account = acc.account.external
    return acc