fix(m01-sl): 표 블록 칸 차례를 정함대로 — 범위가 있는 칸은 조건 · 값 모두 두 칸
- 브레인 정함: 서버가 칸 차례 정본 · 조건 칸 → 값 칸 · 범위 조건 · 범위 값(「20~45」)은 「이름·아래」 「이름·위」 - 그 칸에 수 하나면 아래 · 위에 같은 수 · 빈 칸은 빈 칸 · 블록 왼위 = 「표」 바깥 알약 칸 - f8d777628(값 칸 한 칸 · 「80,100」 글)을 되돌림 · 시험 기대값 맞춤 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KmELpdXFDRZHhfbGuRhSmL
This commit is contained in:
@@ -158,10 +158,12 @@ def test_저장_열기_목록_지우기_서버가_다시_셈(client: TestClient,
|
||||
assert Decimal(book["계산값"]["s1"]["B1"]["수"]) == 2 * price # 서버 다시 셈(999 는 버림)
|
||||
assert "C1" not in cells # 출처 없는 바깥 알약은 안 넣음
|
||||
table = book["시트"][1]["칸"]
|
||||
head = [table[c]["값"] for c in ("A1", "B1", "C1", "D1", "E1")]
|
||||
assert head == ["돌", "높이·아래", "높이·위", "석공", "증가율"] # 머리 줄 · A1 부터
|
||||
assert "B2" not in table and table["C2"]["값"] == 3 and table["E2"]["값"] == "80,100"
|
||||
assert "B3" not in table and "C3" not in table and table["D3"]["값"] == 0.7 # 범위 아님 → 빈 칸
|
||||
head = [table[c]["값"] for c in ("A1", "B1", "C1", "D1", "E1", "F1")]
|
||||
assert head == ["돌", "높이·아래", "높이·위", "석공", "증가율·아래", "증가율·위"] # A1 부터
|
||||
assert (
|
||||
"B2" not in table and table["C2"]["값"] == 3 and table["F2"]["값"] == 100
|
||||
) # 빈 끝은 빈 칸
|
||||
assert table["B3"]["값"] == table["C3"]["값"] == 4 and "E3" not in table # 수 하나 → 같은 수
|
||||
assert saved["logic"]["edges"] == _logic(labor)["edges"]
|
||||
answers = {v["id"]: v for v in saved["values"]}
|
||||
assert set(answers) == {"n1!A1", "n2!A1", "n1:노무비"} and all(
|
||||
@@ -174,7 +176,7 @@ def test_저장_열기_목록_지우기_서버가_다시_셈(client: TestClient,
|
||||
second = _post(client, "/api/m01/sl/save", {"logic": at_e1})
|
||||
assert second["key"] == "SL-0002"
|
||||
moved = second["logic"]["workbook"]["시트"][1]["칸"]
|
||||
assert moved["E1"]["값"] == "돌" and moved["I2"]["값"] == "80,100" and "A1" not in moved
|
||||
assert moved["E1"]["값"] == "돌" and moved["J2"]["값"] == 100 and "A1" not in moved
|
||||
renamed = {**saved["logic"], "name": "고친 이름"}
|
||||
assert _post(client, "/api/m01/sl/save", {"logic": renamed})["key"] == "SL-0001"
|
||||
|
||||
@@ -221,16 +223,11 @@ def test_바깥_값_표_노임_로직_틀린_종류(client: TestClient) -> None:
|
||||
{"id": "z", "kind": "모름"},
|
||||
]
|
||||
got = {v["id"]: v for v in _post(client, "/api/m01/sl/outside", {"items": items})["values"]}
|
||||
assert got["t"]["rows"][0] == [
|
||||
"돌",
|
||||
"높이·아래",
|
||||
"높이·위",
|
||||
"석공",
|
||||
"증가율",
|
||||
] # sub3 layoutOf 차례
|
||||
# 정함: 조건 → 값 · 범위가 있는 칸(조건이든 값이든)은 두 칸 · 수 하나면 아래 · 위 같은 수
|
||||
assert got["t"]["rows"][0] == ["돌", "높이·아래", "높이·위", "석공", "증가율·아래", "증가율·위"]
|
||||
assert got["t"]["rows"][1:] == [
|
||||
["깬돌", None, 3, 0.5, "80,100"],
|
||||
["견치돌", None, None, 0.7, None],
|
||||
["깬돌", None, 3, 0.5, 80, 100],
|
||||
["견치돌", 4, 4, 0.7, None, None],
|
||||
]
|
||||
assert Decimal(str(got["l"]["value"])) == price and got["l"]["unit"]
|
||||
assert Decimal(str(got["g"]["value"])) == Decimal("0.5") * price
|
||||
|
||||
Reference in New Issue
Block a user