fix: 불쾌지수는 기상청처럼 6~9월에만 히어로에 표시 — 선선한 철엔 비 오고 습해도 '쾌적'으로 나와서
This commit is contained in:
1 parent
92620c537b
commit
c0ba463e54
2 files changed
+12
-4
No files matched your search
@@ -53,12 +53,19 @@ def _status(x: HeroInput) -> list[tuple[str, str, str]]:
|
||||
|
||||
|
||||
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)
|
||||
summer = datetime(2026, 7, 7, 14, 20, tzinfo=KST)
|
||||
x = HeroInput(now=summer, 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)
|
||||
x = HeroInput(now=summer, night=False, humidity=72, discomfort=60, uv=6.0, air=AirGrade.BAD)
|
||||
assert _status(x) == [("습도", "습함", "normal"), ("불쾌지수", "쾌적", "normal"), ("자외선", "높음", "warn"), ("미세먼지", "나쁨", "warn")]
|
||||
|
||||
|
||||
def test_status_line_shows_discomfort_only_june_to_september():
|
||||
"""불쾌지수는 더위 지표라 10월 비 오는 날에도 '쾌적'이 나온다. 기상청처럼 6~9월에만."""
|
||||
x = HeroInput(now=NOW, night=False, humidity=95, discomfort=66, uv=1.0, air=AirGrade.GOOD)
|
||||
assert [s.label for s in hero_status(x)] == ["습도", "자외선", "미세먼지"]
|
||||
|
||||
|
||||
def test_status_line_drops_uv_at_night_and_missing_values():
|
||||
assert _status(HeroInput(now=NOW, night=True, after_dark=True, humidity=25, uv=3.0, air=AirGrade.NORMAL)) == [("습도", "건조", "normal"), ("미세먼지", "보통", "normal")]
|
||||
# 저녁 구간(night=True, 아직 해 있음)엔 자외선이 남는다
|
||||
|
||||
Reference in new issue
Block a user