Code_PPII_FS26/tests/test_pricing.py
2026-04-10 15:30:28 +02:00

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"