def test_withdrawal_converted_to_negative(): """ Given a positive amount argument for deposit, the amount value is converted to negative. """ account = Account() amount = 80 account.withdraw(amount) assert account.get_balance() == -80
def test_withdrawal_appended_to_transactions(): """The withdraw instance is appended to transactions""" account = Account() account.deposit(-300) account.withdraw(80) account.withdraw(120) # all of the withdraw instances or 'transactions' should be in Account(object) data = ast.literal_eval(repr(account.transactions)) assert account.get_balance() == sum(row[0] for row in data)
def test_negative_deposits_converted_to_positive(): """ Given a negative amount argument for deposit, the amount value is converted to positive. """ account = Account() amount = -300 account.deposit(amount) assert account.get_balance() == 300