- pyproject.toml: add [tool.ruff] config suppressing E402/W293 globally, F841/E741/E702 in tests, E741 in scripts - inventory.py: split semicolon import (E702) - recipes.py: fix logger -> log (F821 undefined name) - shopping.py: rename l -> lnk in list comprehension (E741) - format_conversion.py: noqa F841 on CUDA flag (used as future hook) - backfill_keywords.py: rename done -> _done (F841) - ingest_purplecarrot.py: drop == True comparison (E712) - Auto-fix: I001 import sorting, F401 unused imports across all files
31 lines
1.4 KiB
Python
31 lines
1.4 KiB
Python
# tests/test_meal_plan_tiers.py
|
|
from app.tiers import can_use
|
|
|
|
|
|
def test_meal_planning_is_free():
|
|
"""Basic meal planning (dinner-only, manual) is available to free tier."""
|
|
assert can_use("meal_planning", "free") is True
|
|
|
|
|
|
def test_meal_plan_config_requires_paid():
|
|
"""Configurable meal types (breakfast/lunch/snack) require Paid."""
|
|
assert can_use("meal_plan_config", "free") is False
|
|
assert can_use("meal_plan_config", "paid") is True
|
|
|
|
|
|
def test_meal_plan_llm_requires_premium():
|
|
"""LLM plan generation requires Premium; BYOK unlocks it on Free/Paid too."""
|
|
assert can_use("meal_plan_llm", "free", has_byok=False) is False
|
|
assert can_use("meal_plan_llm", "free", has_byok=True) is True
|
|
assert can_use("meal_plan_llm", "paid", has_byok=False) is False
|
|
assert can_use("meal_plan_llm", "paid", has_byok=True) is True
|
|
assert can_use("meal_plan_llm", "premium") is True
|
|
|
|
|
|
def test_meal_plan_llm_timing_requires_premium():
|
|
"""LLM time estimation requires Premium; BYOK unlocks it on Free/Paid too."""
|
|
assert can_use("meal_plan_llm_timing", "free", has_byok=False) is False
|
|
assert can_use("meal_plan_llm_timing", "free", has_byok=True) is True
|
|
assert can_use("meal_plan_llm_timing", "paid", has_byok=False) is False
|
|
assert can_use("meal_plan_llm_timing", "paid", has_byok=True) is True
|
|
assert can_use("meal_plan_llm_timing", "premium") is True
|