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.
49 lines
1.9 KiB
Python
49 lines
1.9 KiB
Python
def test_capture_confirm_federation(client):
|
|
cap = client.post(
|
|
"/api/inbox/capture",
|
|
json={"kind": "text", "raw": "다음 주에 한국 놀러가는 비행기 티켓 사기"},
|
|
).json()
|
|
iid = cap["item"]["id"]
|
|
assert cap["classification"]["type"] == "task"
|
|
conf = client.post(f"/api/inbox/{iid}/confirm").json()
|
|
assert conf["item"]["status"] == "confirmed"
|
|
assert conf["item"]["materialized_task_id"]
|
|
assert conf["task"]["title"].startswith("다음 주에 한국")
|
|
# extra(가격 추적 알림)가 notes 에 포함
|
|
assert "가격 추적" in conf["task"]["notes"]
|
|
|
|
|
|
def test_reclassify_force(client):
|
|
cap = client.post(
|
|
"/api/inbox/capture", json={"kind": "text", "raw": "엄마 생신 선물 알아보기"}
|
|
).json()
|
|
iid = cap["item"]["id"]
|
|
re = client.post(f"/api/inbox/{iid}/reclassify", json={"type": "idea"}).json()
|
|
assert re["type"] == "idea"
|
|
|
|
|
|
def test_dismiss(client):
|
|
cap = client.post("/api/inbox/capture", json={"kind": "text", "raw": "잡담"}).json()
|
|
iid = cap["item"]["id"]
|
|
assert client.post(f"/api/inbox/{iid}/dismiss").json()["status"] == "dismissed"
|
|
|
|
|
|
def test_capture_model_is_fake(client):
|
|
# 테스트는 결정적 FakeLLM 주입(conftest) → model 표기 fake
|
|
cap = client.post(
|
|
"/api/inbox/capture", json={"kind": "text", "raw": "수요일 11시 자전거 수리"}
|
|
).json()
|
|
assert cap["classification"]["model"] == "fake"
|
|
|
|
|
|
def test_confirm_event_no_task(client):
|
|
# event 는 confirm 시 task 미생성, 상태만 confirmed
|
|
cap = client.post(
|
|
"/api/inbox/capture", json={"kind": "text", "raw": "수요일 11시 자전거 수리 맡기기"}
|
|
).json()
|
|
iid = cap["item"]["id"]
|
|
conf = client.post(f"/api/inbox/{iid}/confirm").json()
|
|
assert conf["item"]["status"] == "confirmed"
|
|
assert conf["item"]["materialized_task_id"] is None
|
|
assert conf["task"] is None
|