feat: 10/6 회의 반영 — 각 점수 하향, 주말 카드 매일·다음 주말, 일반구를 시로 합침
- 각 점수: 편한 범위 안에서도 최적값에서만 100, 가장 나쁜 요인이 전체를 끌어내림 - 피드 노을 시간대 각 정렬 오류 수정 - 주말 카드 매일 노출, 예보가 닿으면 다음 주말 슬라이드 추가, 주말·행사 탭 열흘 - 지역 256→230 (일반구 39개를 시 13개로) - 회의 기록과 TODO.md 추가
This commit is contained in:
1 parent
a9ddbaab3c
commit
14ddebd040
12 files changed
+156
-76
No files matched your search
@@ -1,4 +1,4 @@
|
||||
from datetime import date
|
||||
from datetime import date, timedelta
|
||||
|
||||
import pytest
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
@@ -20,16 +20,23 @@ async def _posts(day: date):
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_build_day_adds_weekend_post_only_from_thursday():
|
||||
async def test_build_day_adds_weekend_post_every_day():
|
||||
monday, thursday = date(2026, 10, 12), date(2026, 10, 15)
|
||||
await build_feed_day(monday, FeedCRUD(), SeasonCRUD())
|
||||
await build_feed_day(thursday, FeedCRUD(), SeasonCRUD())
|
||||
await build_feed_day(thursday, FeedCRUD(), SeasonCRUD())
|
||||
assert PostType.WEEK.value not in await _posts(monday)
|
||||
assert (await _posts(monday)).count(PostType.WEEK.value) == 1
|
||||
assert (await _posts(thursday)).count(PostType.WEEK.value) == 1
|
||||
assert (await _posts(thursday))[0] == PostType.WEATHER.value
|
||||
|
||||
|
||||
def test_weekends_groups_this_and_next_weekend():
|
||||
from types import SimpleNamespace
|
||||
from services.feed_service import _weekends
|
||||
days = [SimpleNamespace(day=date(2026, 10, 7) + timedelta(days=i)) for i in range(11)]
|
||||
assert [[d.day.day for d in w] for w in _weekends(days)] == [[10, 11], [17]]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_feed_assembles_hero_stories_posts_and_bands(offline):
|
||||
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
|
||||
@@ -125,3 +132,11 @@ async def test_feed_has_quote_and_no_adjacent_same_type(offline):
|
||||
assert all(a != b for a, b in zip(types, types[1:]))
|
||||
assert PostType.QUOTE.value in types
|
||||
assert articles["articles"] and all(a["category"] != 4 for a in articles["articles"])
|
||||
|
||||
|
||||
def test_gak_key_handles_sunset_window():
|
||||
from types import SimpleNamespace
|
||||
from services.feed_service import _gak_key
|
||||
item = SimpleNamespace(definition=SimpleNamespace(windows=[{"around": "sunset", "hours": 1}]), rank=1)
|
||||
assert _gak_key(item, 9) == (0, 8, 1)
|
||||
assert _gak_key(item, 21) == (1, 0, 1)
|
||||
Reference in new issue
Block a user