You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
980 B
Python
27 lines
980 B
Python
import pytest
|
|
|
|
from app.services.scaffold import pick_scaffold
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"title,kind",
|
|
[
|
|
("선행 연구 인터뷰 진행", "연구 · 논문 작성"), # research
|
|
("결제 API 개발", "개발 업무"), # dev
|
|
("OKR 중간 점검 자료 준비", "문서 · 리포트"), # doc (자료/작성)
|
|
("분기 리포트 초안 마무리", "문서 · 리포트"), # doc (리포트/초안)
|
|
("화분 물 주기", "일반 업무"), # generic
|
|
],
|
|
)
|
|
def test_pick_scaffold(title, kind):
|
|
assert pick_scaffold(title)["kind"] == kind
|
|
|
|
|
|
def test_scaffold_create_via_api(client):
|
|
r = client.post("/api/tasks/k6/scaffold", json={"create": True}).json()
|
|
assert r["created"] is True and len(r["created_task_ids"]) == len(r["items"])
|
|
# 생성 후 트리에 하위작업 반영
|
|
t = client.get("/api/tasks/k6").json()
|
|
titles = [c["title"] for c in t["children"]]
|
|
assert "목차 & 범위 정의" in titles
|