Skip to content

Commit

Permalink
Clase 18: Introducción a Pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
lcmartinezdev committed Aug 30, 2024
1 parent 0a348fc commit ab6e6e0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
requests==2.32.3
Faker==28.0.0
coverage==7.6.1
pytest==8.3.2
16 changes: 16 additions & 0 deletions tests/test_pytest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pytest
from src.bank_account import BankAccount


@pytest.mark.parametrize("ammount, expected", [
(100, 1100),
(3000, 4000),
(4500, 5500),
])
def test_deposit_multiple_ammounts(ammount, expected):
account = BankAccount(balance=1000, log_file="transactions.txt")
new_balance = account.deposit(ammount)
assert new_balance == expected



24 changes: 24 additions & 0 deletions transactions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Cuenta creada
Deposited 100. New balance: 1100
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
Cuenta creada
Deposited 100. New balance: 1100
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 ab6e6e0

Please sign in to comment.