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.
34 lines
1.4 KiB
Python
34 lines
1.4 KiB
Python
# backend/tests/test_agents_travel_examples.py
|
|
def test_plan_jeju_golden(client):
|
|
r = client.post(
|
|
"/api/trip/plan",
|
|
json={"text": "다음 달 말 제주 가족여행 3박 4일, 렌터카 빌리고 예산 150만원"},
|
|
)
|
|
p = r.json()
|
|
assert p["id"] == "plan_jeju" and p["custom"] is False
|
|
assert p["budget"]["total"] == "1,287,000" and p["budget"]["cap"] == "1,500,000"
|
|
picks = [o for o in p["transport"] if o.get("pick")]
|
|
assert len(picks) == 2 and p["transport"][0]["price"] == "356,000"
|
|
assert p["checklist"][-1] == "카시트 (렌터카 옵션 신청 완료)"
|
|
|
|
|
|
def test_plan_tokyo_golden(client):
|
|
r = client.post("/api/trip/plan", json={"text": "도쿄 출장 2박 3일, 시부야 근처 호텔로 잡아줘"})
|
|
p = r.json()
|
|
assert p["id"] == "plan_tokyo" and p["title"] == "도쿄 출장"
|
|
assert p["budget"]["total"] == "713,000"
|
|
assert p["sources"] == [
|
|
"항공사 3곳 실시간 운임",
|
|
"숙박앱 평점·후기",
|
|
"환율·엔저 추이",
|
|
"현지 교통 안내",
|
|
]
|
|
|
|
|
|
def test_plan_freeform_fallback(client):
|
|
text = "부산 당일치기로 바닷바람 쐬고 오기"
|
|
r = client.post("/api/trip/plan", json={"text": text})
|
|
p = r.json()
|
|
assert p["id"] == "plan_jeju" and p["custom"] is True
|
|
assert p["title"] == text[:18] # 원본 pickResult: slice(0,18)
|