fix(b05,b08): C군 벽 높이 없어도 놓임 — 높이가 밑수인 벽은 줄만 서고 미확정(판정 ①)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""높이 없이 놓인 벽 — **놓기는 되고 줄은 서되 미확정(금액 밖)** (2026-09-14 브레인 판정 ①).
|
||||
|
||||
앞서 B05 폼이 C군 높이가 비면 놓기를 막았음. 우리 규칙 「줄은 서고 금액은 안 섬」과 어긋나 풀고,
|
||||
높이가 물량 밑수인 벽(옹벽·돌쌓기 찰/메·큰돌쌓기)은 B08 표에서 미확정으로 뜨게 함.
|
||||
흙막이(떼 개소당)는 높이를 안 써 그대로.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from B08_Quantity.B08_Quantity_Engine_UnitQuantity import build_table # noqa: E402
|
||||
from B08_Quantity.B08_Quantity_Engine_UnitQuantity_Base import ( # noqa: E402
|
||||
UNCONFIRMED_NO_HEIGHT,
|
||||
missing_height_reason,
|
||||
)
|
||||
|
||||
COMMIT = (ROOT / "B05_Profile" / "B05_Profile_UI_Structures_Panel_Commit.ts").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
|
||||
def _wall(type_id: str = "masonry_wet", **options) -> dict:
|
||||
return {
|
||||
"structure_id": "w",
|
||||
"type_id": type_id,
|
||||
"start_m": 0.0,
|
||||
"end_m": 10.0,
|
||||
"options": {
|
||||
"length_m": 10.0,
|
||||
"back_len_cm": 45,
|
||||
"stone_kind": "깬돌",
|
||||
"foundation": "기초유",
|
||||
**options,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_높이_없는_돌쌓기는_미확정으로_선다() -> None:
|
||||
table = build_table([_wall()], {"masonry_wet": "돌쌓기(찰)"}, {})
|
||||
row = table["structures"][0]
|
||||
assert row["unconfirmed"] == UNCONFIRMED_NO_HEIGHT
|
||||
|
||||
|
||||
def test_높이를_적으면_미확정이_아니다() -> None:
|
||||
table = build_table([_wall(height_m=2.0)], {"masonry_wet": "돌쌓기(찰)"}, {})
|
||||
assert table["structures"][0]["unconfirmed"] == ""
|
||||
|
||||
|
||||
def test_높이를_안_쓰는_종류는_그대로() -> None:
|
||||
assert missing_height_reason(_wall("soil_guard")) == ""
|
||||
for type_id in ("retaining_wall", "masonry_dry", "boulder_masonry"):
|
||||
assert missing_height_reason(_wall(type_id)) == UNCONFIRMED_NO_HEIGHT, type_id
|
||||
assert missing_height_reason(_wall(type_id, height_m="1.5")) == "", type_id
|
||||
|
||||
|
||||
def test_폼이_높이_빈칸으로_놓기를_안_막는다() -> None:
|
||||
assert "height?.isEmpty()" not in COMMIT
|
||||
Reference in New Issue
Block a user