Skip to content

Commit

Permalink
Se agrega pytest para las pruebas unitarias
Browse files Browse the repository at this point in the history
  • Loading branch information
Julio Sarango committed Nov 15, 2024
1 parent 53a8c30 commit e489c4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_bank_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def test_deposit_with_negative_amount_not_increase(self):
with self.assertRaises(ValueError):
self.assertEqual(self.account.deposit(-50))

def test_withdraw(self):
@patch("src.bank_account.datetime")
def test_withdraw(self, mock_datetime):
mock_datetime.now.return_value.hour = 10
new_balance = self.account.withdraw(200)
self.assertEqual(new_balance, 800)

Expand Down
6 changes: 6 additions & 0 deletions transaccions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,9 @@ Cuenta creada
Deposited 3000- New balance: 4000
Cuenta creada
Deposited 4500- New balance: 5500
Cuenta creada
Deposited 100- New balance: 1100
Cuenta creada
Deposited 3000- New balance: 4000
Cuenta creada
Deposited 4500- New balance: 5500

0 comments on commit e489c4e

Please sign in to comment.