feat: DEFAULT_TOPICS_SEED + ensure_topics_seeded

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
th-kim0823
2026-04-27 19:51:35 +09:00
parent 6c6929a505
commit 546bd54700
2 changed files with 107 additions and 0 deletions

View File

@@ -278,6 +278,27 @@ def t_topics_helpers():
assert get_topics() == sample2
def t_topics_seeded_after_assign():
from app import get_topics, _empty_state, save_data, load_data
# 빈 상태로 reset
save_data(_empty_state())
assert get_topics() == []
from assign_teams import ensure_topics_seeded
data = load_data()
ensure_topics_seeded(data)
save_data(data)
cats = get_topics()
assert len(cats) == 4
for c in cats:
assert len(c["items"]) == 10
assert c["id"] in ("T1", "T2", "T3", "T4")
assert c["title"]
assert c["tagline"]
assert c["tone"]
if __name__ == "__main__":
print(f"# E2E (data={TEST_DATA})\n")
test("hackathon.json 로드 (34명, 7팀)", t_load)
@@ -296,6 +317,7 @@ if __name__ == "__main__":
test("load_data nested 키 backfill", t_load_data_backfills_nested_settings)
test("stage 헬퍼", t_stage_helpers)
test("topics 헬퍼", t_topics_helpers)
test("topics 시드", t_topics_seeded_after_assign)
fails = sum(1 for r, _ in results if r == FAIL)
print(f"\n# {len(results)} 중 통과 {len(results) - fails}, 실패 {fails}")