Esempio n. 1
0
def test_local_account(app):
    """Create a local account"""

    # Add the local account
    with open('tests/data/local.cfg') as f:
        config = json.load(f)

    account = Account(name='local', backend=config)
    account.insert()

    yield account

    # Purge the account
    account.purge()
Esempio n. 2
0
def test_backends(app):
    """Create accounts to support each backend"""

    # Add the test accounts for each backend
    accounts = []
    for backend in ['local', 's3']:

        with open('tests/data/{backend}.cfg'.format(backend=backend)) as f:
            config = json.load(f)

        account = Account(name=backend, backend=config)
        account.insert()
        accounts.append(account)

    yield accounts

    # Purge the accounts
    for account in accounts:
        account.purge()
Esempio n. 3
0
def test_accounts(app):
    """Load test accounts"""

    # Load the test account information
    with open('tests/data/accounts.json') as f:
        data = json.load(f)

    # Add the test accounts
    accounts = []
    for account_data in data:

        with open('tests/data/' + account_data['config_filepath']) as f:
            config = json.load(f)

        account = Account(name=account_data['name'], backend=config)
        account.insert()
        accounts.append(account)

    yield accounts

    # Purge the accounts
    for account in accounts:
        account.purge()