fix: 각 정의 검토 반영 — 지금 비 오면 바깥 각 상한(비 소식 조건), 습도 상한, 시간대가 구간과 2시간 이상 겹쳐야 구간 점수, 뜨아·환기·김서림·화장붕괴·냉면·택시·배달·야구·사진·공부·넷플릭스·군밤·연날리기·이불빨래·실내건조·귤·군고구마·붕어빵·눈사람·빙수·캠핑·단풍·해돋이 비중·조건 조정, 새 각 우산·파전·감성노래
This commit is contained in:
1 parent
c0ba463e54
commit
d020d27715
7 files changed
+505
-76
No files matched your search
@@ -290,3 +290,21 @@ def test_weather_score_100_only_on_perfect_day():
|
||||
|
||||
good = [_h(h, feels=22.5, prob=10, wind=2.5, hum=62, sunshine_ratio=0.7) for h in range(9, 22)]
|
||||
assert evaluate(WEATHER_SCORE_DEF, [good], replace(perfect, pm25=15)).score < 95
|
||||
|
||||
|
||||
def test_raining_now_caps_even_with_low_rain_prob():
|
||||
"""초단기예보로 비가 들어온 시각은 예보 확률이 낮아도 '비 소식' 상한이 걸린다."""
|
||||
defn = _defn(zero_rules=[{"field": "rain", "op": "==", "value": "yes", "cap": 20}])
|
||||
r = evaluate(defn, [[_h(19, prob=30, rain=RainType.RAIN)]], CTX)
|
||||
assert r.score <= 20 and r.zero_reason == "비 소식이 있어 최대 20점"
|
||||
assert evaluate(defn, [[_h(19, prob=30)]], CTX).zero_reason is None
|
||||
|
||||
|
||||
def test_humidity_cap():
|
||||
defn = _defn(zero_rules=[{"field": "humidity", "op": ">=", "value": 85, "cap": 40}])
|
||||
assert evaluate(defn, [[_h(19, hum=92)]], CTX).zero_reason == "습도 85% 이상이라 최대 40점"
|
||||
assert zero_rules_text([{"field": "rain", "op": "==", "value": "yes"}]) == "비 소식이 있으면 0점"
|
||||
|
||||
|
||||
def test_axis_label_can_be_overridden():
|
||||
assert axis_label("temp", {"temp": {"type": "higher", "label": "덜 추움"}}) == "덜 추움"
|
||||
Reference in new issue
Block a user