feat: testing tutorial
This commit is contained in:
parent
51964de52c
commit
17297aaf7d
2
src/tutorial/testing/shop/pricing.py
Normal file
2
src/tutorial/testing/shop/pricing.py
Normal file
@ -0,0 +1,2 @@
|
||||
def discount_price(price: float, percent: float) -> float:
|
||||
return price - price * percent / 100
|
||||
6
tests/test_tutorial/shop/test_pricing.py
Normal file
6
tests/test_tutorial/shop/test_pricing.py
Normal file
@ -0,0 +1,6 @@
|
||||
from src.tutorial.testing.shop.pricing import discount_price
|
||||
|
||||
|
||||
def test_discount_price_reduces_price():
|
||||
result = discount_price(100.0, 20.0)
|
||||
assert result == 80
|
||||
Loading…
x
Reference in New Issue
Block a user