fix(b08): 관측 원단위 줄도 갈 곳 기본값 금지 — destination 없는 줄은 막고 사유(종전 or material 로 조용히 자재행) · 표 전 줄 갈 곳 시험

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
This commit is contained in:
2026-09-14 12:22:35 +09:00
co-authored by Claude Opus 5
parent 2604e9e914
commit 560df4ac83
2 changed files with 43 additions and 2 deletions
@@ -53,3 +53,36 @@ def test_드러난_넷이_제자리로_감() -> None:
sod, sod_notes = soil_guard({"form": "떼"})
assert {c.name: c.destination for c in sod}["떼"] == "material"
assert not [note for note in sod_notes if "갈 곳이 표" in note]
def test_관측_원단위_줄도_갈_곳이_없으면_막히고_사유() -> None:
"""관측 원단위 로더의 `destination or "material"` 도 같은 병 — 줄이 늘 때 바로 드러나게."""
from B08_Quantity.B08_Quantity_Engine_ObservedUnit import ObservedUnitTable, expand_observed
table = ObservedUnitTable(
entries=[
{
"type_id": "시험구조물",
"unit": "개소",
"components": [
{"name": "콘크리트", "unit": "㎥", "amount": 1.0, "destination": "unit_price"},
{"name": "새자재", "unit": "㎥", "amount": 2.0},
],
}
]
)
components, notes = expand_observed("시험구조물", {}, {"options": {}}, table)
assert [c["name"] for c in components] == ["콘크리트"]
assert any("새자재" in note and "기본값 금지" in note for note in notes)
def test_관측_원단위_표의_전_줄에_갈_곳이_있음() -> None:
from B08_Quantity.B08_Quantity_Engine_ObservedUnit import load_observed_table
missing = [
(entry.get("type_id"), item.get("name"))
for entry in load_observed_table().entries
for item in entry.get("components") or []
if not item.get("destination")
]
assert missing == []