Exemplo n.º 1
0
def test_account(bucket):
    name = "test account"
    description = "This is a test account"

    push_is_running_service()

    try:
        account = Account(name, description, bucket=bucket)

        assert (account.name() == name)
        assert (account.description() == description)
        assert (not account.is_null())

        uid = account.uid()
        assert (uid is not None)

        account2 = Account(uid=uid, bucket=bucket)

        assert (account2.name() == name)
        assert (account2.description() == description)

        assert (account.balance() == Balance())
    except:
        pop_is_running_service()
        raise

    pop_is_running_service()
Exemplo n.º 2
0
def account2(bucket):
    account = Account("Testing Account",
                      "This is a second testing account",
                      bucket=bucket)
    uid = account.uid()
    assert (uid is not None)
    assert (account.balance() == 0)
    assert (account.liability() == 0)

    account.set_overdraft_limit(account2_overdraft_limit)
    assert (account.get_overdraft_limit() == account2_overdraft_limit)

    return account
Exemplo n.º 3
0
def account1(bucket):
    push_is_running_service()
    accounts = Accounts(user_guid=account1_user)
    account = Account(name="Testing Account",
                      description="This is the test account",
                      group_name=accounts.name(),
                      bucket=bucket)
    uid = account.uid()
    assert (uid is not None)
    assert (account.balance() == Balance())

    account.set_overdraft_limit(account1_overdraft_limit)
    assert (account.get_overdraft_limit() == account1_overdraft_limit)
    pop_is_running_service()

    return account
Exemplo n.º 4
0
def account2(bucket):
    if not have_freezetime:
        return None

    with freeze_time(start_time) as frozen_datetime:
        now = datetime.datetime.now()
        assert (frozen_datetime() == now)
        account = Account("Testing Account", "This is the test account")

        uid = account.uid()
        assert (uid is not None)
        assert (account.balance() == 0)
        assert (account.liability() == 0)

        account.set_overdraft_limit(account2_overdraft_limit)
        assert (account.get_overdraft_limit() == account2_overdraft_limit)

    return account
Exemplo n.º 5
0
def test_account(bucket):
    name = "test account"
    description = "This is a test account"

    account = Account(name, description, bucket=bucket)

    assert (account.name() == name)
    assert (account.description() == description)
    assert (not account.is_null())

    uid = account.uid()
    assert (uid is not None)

    account2 = Account(uid=uid, bucket=bucket)

    assert (account2.name() == name)
    assert (account2.description() == description)

    assert (account.balance() == 0)
Exemplo n.º 6
0
def account1(bucket):
    if not have_freezetime:
        return None

    with freeze_time(start_time) as _frozen_datetime:
        now = get_datetime_now()
        assert (start_time == now)
        push_is_running_service()
        accounts = Accounts(user_guid=account1_user)
        account = Account(name="Testing Account",
                          description="This is the test account",
                          group_name=accounts.name())
        uid = account.uid()
        assert (uid is not None)
        assert (account.balance() == Balance())

        account.set_overdraft_limit(account1_overdraft_limit)
        assert (account.get_overdraft_limit() == account1_overdraft_limit)
        pop_is_running_service()

    return account