def test_transactions_withdraw(self): expected_transactions = [ ('OPEN', 100, 100), ('WITHDRAWAL', -40, 60), ] account = BankAccount(balance=100) account.withdraw(40) self.assertEqual(account.transactions, expected_transactions)
def test_transactions_scenario(self): expected_transactions = [ ('OPEN', 0, 0), ('DEPOSIT', 100, 100), ('WITHDRAWAL', -40, 60), ('DEPOSIT', 95, 155), ] account = BankAccount() account.deposit(100) account.withdraw(40) account.deposit(95) self.assertEqual(account.transactions, expected_transactions)
def test_withdraw(self): account = BankAccount(balance=100) account.withdraw(40) self.assertEqual(account.balance, 60)