fix: 주말 전국 날씨 순위가 전국 비인 날 전부 47점이던 것 — 나들이 점수의 비 상한(최대 30점)을 없애 비 오는 날도 기온·하늘·바람에 따라 점수가 갈림. 바꾸기 표 다시 생성, 순위 캐시 키 v3 (main 939edee 와 같은 내용)
This commit is contained in:
1 parent
e64b001bf9
commit
c02f91c6d8
7 files changed
+46
-42
No files matched your search
@@ -252,10 +252,20 @@ def test_outing_cloudy_and_hot_days_lose_points():
|
||||
assert "흐림" in cloudy.reason
|
||||
|
||||
|
||||
def test_outing_rain_caps_score():
|
||||
r = outing(_day(prob=70))
|
||||
assert r.score <= 30 and r.capped
|
||||
assert outing([_h(10, prob=30, rain=RainType.RAIN)] + _day()[1:]).score <= 30
|
||||
def test_outing_rain_lowers_score_without_a_cap():
|
||||
"""비가 오면 비 점수와 가장 낮은 요소 때문에 점수가 내려가지만, 따로 상한으로 묶지는 않는다."""
|
||||
clear = outing(_day())
|
||||
likely = outing(_day(prob=70))
|
||||
raining = outing([_h(10, prob=30, rain=RainType.RAIN)] + _day()[1:])
|
||||
assert raining.score < likely.score < clear.score
|
||||
assert likely.score > 30 and raining.score > 30
|
||||
|
||||
|
||||
def test_outing_rainy_days_keep_their_differences():
|
||||
"""전국이 비인 날에도 기온·하늘에 따라 점수가 갈린다 (예전엔 모두 상한 30점에 걸려 같은 점수였다)."""
|
||||
mild = outing(_day(feels=16.0, sky=Sky.CLOUDY, rain=RainType.RAIN))
|
||||
chilly = outing(_day(feels=14.0, sky=Sky.CLOUDY, rain=RainType.RAIN))
|
||||
assert chilly.score < mild.score
|
||||
|
||||
|
||||
def test_outing_needs_all_hours():
|
||||
@@ -266,7 +276,7 @@ def test_outing_estimate_from_mid_forecast():
|
||||
r = outing_estimate(_fc(lo=12, hi=22, am=10, pm=20))
|
||||
assert r.estimated is True and r.factors["wind"] == 70
|
||||
assert r.reason.startswith("비 20% · 낮 ")
|
||||
assert outing_estimate(_fc(pm=60)).score <= 30
|
||||
assert 30 < outing_estimate(_fc(pm=60)).score < outing_estimate(_fc(pm=0)).score
|
||||
assert outing_estimate(_fc(lo=None, hi=None)) is None
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user