feat: 새 각 4개 추가 (야구·공부·넷플릭스·군밤)

This commit is contained in:
minaChoi committed 2026-10-06 10:02:55 +09:00
1 parent 14ddebd040
commit d764d0e9ed
11 files changed
+217 -6

No files matched your search

+1 -1
View File
@@ -43,7 +43,7 @@ async def test_feed_assembles_hero_stories_posts_and_bands(offline):
body = (await client.get("/v1/feed", params={"region": REGION})).json()
assert body["result"]["success"] is True
assert body["hero"]["temp_c"] == 20 and body["hero"]["top1"]["rank"] == 1 and "top3" not in body["hero"]
assert len(body["stories"]) == 23
assert len(body["stories"]) == 27
weather = next(p for p in body["posts"] if p["post_type"] == PostType.WEATHER.value)
assert [s["kind"] for s in weather["slides"]] == ["hours", "rows"]
assert len(weather["slides"][0]["hours"]) == 8
+2 -2
View File
@@ -39,11 +39,11 @@ def fakes(monkeypatch):
@pytest.mark.anyio
async def test_index_list_ranks_all_23_with_3_day_trend(fakes):
async def test_index_list_ranks_all_27_with_3_day_trend(fakes):
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
body = (await client.get("/v1/index/list", params={"region": REGION})).json()
assert body["result"]["success"] is True
assert len(body["items"]) == 23 and len(body["top3"]) == 3
assert len(body["items"]) == 27 and len(body["top3"]) == 3
scores = [i["score"] for i in body["items"]]
assert scores == sorted(scores, reverse=True)
assert all(len(i["trend"]) == 3 for i in body["items"])
+7
View File
@@ -47,6 +47,13 @@ def test_temp_peaks_at_best_and_loses_8_per_degree_outside():
assert temp_score({"type": "range", "lo": 10, "hi": 20, "offset": -6}, 21)[1].startswith("정상 15°")
def test_temp_away_rises_outside_comfort():
rule = {"type": "away", "lo": 15, "hi": 24}
assert temp_score(rule, 20)[0] == 30
assert temp_score(rule, 34)[0] == 100
assert temp_score(rule, 5)[0] == 100
def test_rain_dry_and_wet():
assert rain_score({"dir": "dry"}, 30, False)[0] == 70
assert rain_score({"dir": "dry"}, 30, True)[0] == 0