Files
Tirsvad 07b46f0180 MIL-003 e-mail alert (Step 2)
Delivers MIL-003 (lecture Step 2): an alert e-mail with title, price and buy link is sent over SMTP (port 587, STARTTLS) when the price is below the target 100. SMTP address, e-mail address and password are read from `.env` with python-dotenv (`.env.example` lists them). Tests use fakes and never open a network or SMTP connection.

Review: code against QC-PY-001 as RC-012 (Go, autonomous, not independent). 33 pytest tests, ruff and mypy --strict pass. The Step 2 screenshots come from a run with a stubbed SMTP connection; no real mail was sent.

Task: MIL-003#1
Task: MIL-003#2
Task: MIL-003#3
Task: MIL-003#4
Task: MIL-003#5
2026-10-28 14:44:18 +08:00

14 lines
379 B
Python

from amazon_price_tracker.domain.pricing import is_below_target
def test_is_below_target_true_when_price_lower() -> None:
assert is_below_target(99.99, 100.0)
def test_is_below_target_false_when_price_equal() -> None:
assert not is_below_target(100.0, 100.0)
def test_is_below_target_false_when_price_higher() -> None:
assert not is_below_target(100.01, 100.0)