15 lines
386 B
Python
15 lines
386 B
Python
from src.u6_tests.pricing import discount_price
|
|
|
|
|
|
def test_discount_price_reduces_price():
|
|
result = discount_price(100.0, 20.0)
|
|
assert result == 80.0
|
|
|
|
|
|
def test_discount_price_negative_discount():
|
|
try:
|
|
discount_price(100.0, -20.0)
|
|
assert False, "Expected ValueError"
|
|
except ValueError as e:
|
|
assert str(e) == "Discount percent cannot be negative"
|