feat: 오늘 히어로 D4-2 — 해 안 점수, 상태 한 줄(습도·불쾌지수·자외선·미세먼지 단계), 하루 흐름 칸이 미리보기 탭, 구름·비·눈 연출 / 각 시간대별 점수·순위 미리보기 / 자외선 시간표 단계 색 칩 / 밤 화면 어두운 아이콘 빛
This commit is contained in:
1 parent
4cdc8b274f
commit
aa774c2a44
13 files changed
+367
-155
No files matched your search
@@ -2,7 +2,7 @@ from datetime import datetime, timedelta
|
||||
|
||||
from common.enums import AirGrade
|
||||
from common.utils.kma_time import KST
|
||||
from services.hero_stats import HeroInput, hero_stats
|
||||
from services.hero_stats import HeroInput, hero_stats, hero_status
|
||||
|
||||
NOW = datetime(2026, 10, 7, 14, 20, tzinfo=KST)
|
||||
|
||||
@@ -46,3 +46,19 @@ def test_one_coldwind_card_only():
|
||||
|
||||
def test_nothing_known_gives_nothing():
|
||||
assert hero_stats(HeroInput(now=NOW, night=False)) == []
|
||||
|
||||
|
||||
def _status(x: HeroInput) -> list[tuple[str, str, str]]:
|
||||
return [(s.label, s.value, s.tone) for s in hero_status(x)]
|
||||
|
||||
|
||||
def test_status_line_has_four_by_day_and_warns_only_caution():
|
||||
x = HeroInput(now=NOW, night=False, humidity=55, discomfort=75, uv=4.2, air=AirGrade.GOOD)
|
||||
assert _status(x) == [("습도", "보통", "normal"), ("불쾌지수", "불쾌", "warn"), ("자외선", "보통", "normal"), ("미세먼지", "좋음", "normal")]
|
||||
x = HeroInput(now=NOW, night=False, humidity=72, discomfort=60, uv=6.0, air=AirGrade.BAD)
|
||||
assert _status(x) == [("습도", "습함", "normal"), ("불쾌지수", "쾌적", "normal"), ("자외선", "높음", "warn"), ("미세먼지", "나쁨", "warn")]
|
||||
|
||||
|
||||
def test_status_line_drops_uv_at_night_and_missing_values():
|
||||
assert _status(HeroInput(now=NOW, night=True, humidity=25, uv=3.0, air=AirGrade.NORMAL)) == [("습도", "건조", "normal"), ("미세먼지", "보통", "normal")]
|
||||
assert _status(HeroInput(now=NOW, night=False)) == []
|
||||
Reference in new issue
Block a user