fix: df3fba7 에 섞여 들어간 옛 파일 되돌림 — 쇼츠 RSS·사주 생년월일 저장·생성 API 클라이언트를 ca6d55f 상태로

This commit is contained in:
minaChoi committed 2026-10-29 09:14:04 +09:00
1 parent cf7c96eaff
commit 051452d3b1
21 files changed
+865 -311

No files matched your search

+27 -1
View File
@@ -37,6 +37,8 @@ async def test_reading_for_anyone_gives_me_today_and_cards(offline):
assert r["me"]["scene"].endswith("기운") and r["today"]["title"] and 0 <= r["today"]["score"] <= 100
kinds = [x["kind"] for x in r["today"]["cards"]]
assert "when" in kinds and "do" in kinds and "wear" in kinds
# 근거 줄은 쉬운 말 + 괄호 용어, 숫자 없이
assert r["today"]["why"] and not any(ch.isdigit() for w in r["today"]["why"] for ch in w)
# 로그인 안 하면 레벨로 여는 것은 모두 잠김, 내용도 안 옴
assert r["logged_in"] is False and all(not x["unlocked"] for x in r["locks"])
assert "week" not in r and "love" not in r and "money" not in r
@@ -68,7 +70,7 @@ async def test_level_unlocks_sections_and_awards_once(offline):
h7 = await _login(c, "saju_07", points=1000)
r = (await c.post("/v1/saju/reading", json=BIRTH, headers=h7)).json()
assert r["month"]["title"].endswith("달") and "년" in r["year"]["label"] and len(r["year"]["months"]) == 3
assert r["month"]["title"].endswith("달") and "년" in r["year"]["label"] and 1 <= len(r["year"]["months"]) <= 3
@pytest.mark.anyio
@@ -81,3 +83,27 @@ async def test_match_needs_level_five(offline):
h5 = await _login(c, "match_05", points=400)
m = (await c.post("/v1/saju/match", json=body, headers=h5)).json()
assert m["title"].endswith("사이") and m["lines"] and 0 <= m["score"] <= 100 and m["day"]["weekday"] and m["friend_scene"].endswith("기운")
@pytest.mark.anyio
async def test_match_score_is_same_whoever_goes_first(offline):
a, b = {"birth_date": "1995-03-14"}, {"birth_date": "1996-11-02"}
async with client() as c:
h = await _login(c, "match_sym", points=400)
ab = (await c.post("/v1/saju/match", json={"region_code": REGION, "me": a, "friend": b}, headers=h)).json()
ba = (await c.post("/v1/saju/match", json={"region_code": REGION, "me": b, "friend": a}, headers=h)).json()
assert ab["score"] == ba["score"]
@pytest.mark.anyio
async def test_birth_is_saved_to_account(offline):
body = {"birth_date": "1995-03-14", "birth_time": "07:30", "place": "busan", "gender": "female"}
async with client() as c:
assert (await c.get("/v1/saju/birth")).status_code == 401
h = await _login(c, "birth_01")
assert "birth" not in (await c.get("/v1/saju/birth", headers=h)).json()
assert (await c.put("/v1/saju/birth", json=body, headers=h)).json()["birth"] == body
assert (await c.get("/v1/saju/birth", headers=h)).json()["birth"] == body
assert (await c.put("/v1/saju/birth", json={**body, "birth_date": "1899-12-31"}, headers=h)).json()["result"]["desc"] == "INVALID_INPUT"
await c.delete("/v1/saju/birth", headers=h)
assert "birth" not in (await c.get("/v1/saju/birth", headers=h)).json()