45 lines
1.4 KiB
Python
45 lines
1.4 KiB
Python
import sys, os
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
|
|
|
|
from app.notifiers.telegram_lotto import _format_briefing, _format_prize_alert
|
|
|
|
|
|
def test_briefing_with_retrospective():
|
|
payload = {
|
|
"draw_no": 1154,
|
|
"confidence": 72,
|
|
"narrative": {
|
|
"headline": "안정 +1, 콜드 누적 보강",
|
|
"summary_3lines": ["a", "b", "c"],
|
|
"retrospective": "너 2.0 / 나 1.8 — 저번호 편향",
|
|
},
|
|
"picks": {
|
|
"core": [
|
|
{"risk_tag": "안정"}, {"risk_tag": "안정"}, {"risk_tag": "안정"},
|
|
{"risk_tag": "균형"}, {"risk_tag": "공격"},
|
|
],
|
|
"bonus": [], "extended": [], "pool": [],
|
|
},
|
|
}
|
|
text = _format_briefing(payload)
|
|
assert "1154회" in text
|
|
assert "신뢰도 72" in text
|
|
assert "안정 3" in text
|
|
assert "회고: 너 2.0" in text
|
|
|
|
|
|
def test_briefing_without_retrospective():
|
|
payload = {
|
|
"draw_no": 1, "confidence": 50,
|
|
"narrative": {"headline": "h", "summary_3lines": ["a","b","c"], "retrospective": ""},
|
|
"picks": {"core": [{"risk_tag":"안정"}]*5, "bonus":[],"extended":[],"pool":[]},
|
|
}
|
|
text = _format_briefing(payload)
|
|
assert "회고" not in text
|
|
|
|
|
|
def test_prize_alert():
|
|
text = _format_prize_alert({"draw_no": 1154, "match_count": 5, "numbers": [3,11,17,25,33,8]})
|
|
assert "5개 일치" in text
|
|
assert "3, 11, 17, 25, 33, 8" in text
|