523d970c45
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
18 lines
664 B
Python
18 lines
664 B
Python
"""比价报警配置默认值与关键词解析。"""
|
|
from __future__ import annotations
|
|
|
|
from app.core.config import settings
|
|
|
|
|
|
def test_defaults() -> None:
|
|
assert settings.COMPARE_ALERT_ENABLED is False
|
|
assert settings.COMPARE_ALERT_SCAN_INTERVAL_SEC == 900
|
|
assert settings.COMPARE_ALERT_CANCELLED_MS_THRESHOLD == 90000
|
|
assert settings.COMPARE_ALERT_CANCELLED_STEP_THRESHOLD == 30
|
|
|
|
|
|
def test_keyword_parsing() -> None:
|
|
assert settings.compare_alert_timeout_keywords == ("超时", "启动", "加载")
|
|
assert settings.compare_alert_unrecognized_keywords == ("未识别",)
|
|
assert "打烊" in settings.compare_alert_biz_exclude_keywords
|