Files
Aislo/resources/tester/test_52_9_spoil_borrow.py
T
eomsangdonandClaude Opus 5.5 3898cb0019 refactor(380-1): 사토장 횡단 그림 · 사토 단면 셈 지움 — 부품 처음값 형상 · 3D 없음
- 부품 처음값 spoil_bank 형상 · 3D = none · 형상 부품 「사토(성토 채움)」 지움
- 사토 단면 셈 파이썬 · TS 짝 지움(Engine_SpoilFill · common_util_spoil_fill · spoil_fill 옵션 · fill_area_beyond)
- 카드 그림 · 면적표 줄 · 모달 띠 · 고름 선 · B07 표 「사토장」 칸 지움(빈 줄로 되돌림)
- B08 수량 · 유토 배분(haul-plan) 미사용 확인 · 남은 사토 값 = [저장] 서버 재계산 · 브라우저 단계 다시 셈으로 정리
- 시험 고쳐 씀: 322_1 · 349_0n · b06_spoil_fill_allocation(남은 값 정리) · spoil_fill_mirror(죽은 길) · 52_9 · cross_design_mirror · 150 · 164 · 179_4 · 316

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
2026-10-17 14:56:42 +09:00

83 lines
3.4 KiB
Python

"""PLAN 52-9 — 안전부대용지 › 사토장 · 토취장 = 사용자 구조물 표 08.
· 있는 종류 키 그대로(spoil_bank · borrow_pit) · 기준 측점 + 컨테이너 「상세 내용」(정의 그룹) 하나
· 부피 손 입력 = 옛 용량 키 `capacity_m3`(상세 CAD 글 「사토장 부피」 · 380)
· 옛 칸은 정의에서 빼 지난 정의 값
· 잇기 = 그룹 id(`group_items`) — 집계 표가 그룹마다 한 줄
"""
import json
from pathlib import Path
from B05_Profile.B05_Profile_Structures_Schema import DEFINITION_PATH, load_structure_types
from common_util.common_util_structure_catalog import catalog_row
from M02_MasterTemplete.M02_Table_Fill import _with_group_items
from M02_MasterTemplete.StructOptions import M02_SO_Definition
from M02_MasterTemplete.StructOptions.M02_SO_Groups import groups_of
KINDS = {
"spoil_bank": ("유용토운반작업장(사토장)", "사토장 부피", "gspoildetail"),
"borrow_pit": ("토사채취장(토취장)", "토취장 부피", "gborrowdetail"),
}
def test_옵션은_부피_하나_손_입력():
by_id = {t.type_id: t for t in load_structure_types()}
for type_id, (name, label, _) in KINDS.items():
item = by_id[type_id]
assert item.group == "E" and item.name == name and item.managed_by is None
assert [o.key for o in item.options] == ["capacity_m3"]
volume = item.options[0]
assert volume.label == label and volume.input == "number" and volume.unit == "㎥"
assert volume.phase == "b05" and not volume.required and volume.default is None
def test_컨테이너_상세_내용_하나_부피를_담음():
groups = groups_of()
for type_id, (_, _, gid) in KINDS.items():
assert groups[type_id] == [{"id": gid, "name": "상세 내용", "options": ["capacity_m3"]}]
def test_정의_검사_통과_판_이력():
doc = json.loads(Path(DEFINITION_PATH).read_text("utf-8"))
assert M02_SO_Definition.check(doc) == []
assert M02_SO_Definition.history_path(doc["판"] - 1).is_file()
def test_잇기는_그룹마다_집계_한_줄():
link = {"source": "SS", "code": "SS-000001", "name": "사토장"}
rows = _with_group_items(
[
{
"type_id": "spoil_bank",
"복사본": "s1",
"summary_item": None,
"group_items": {"gspoildetail": link},
}
]
)
assert [r["복사본"] for r in rows] == ["s1", "s1__gspoildetail"]
assert rows[1]["summary_item"] == link and rows[1]["그룹"] == "상세 내용"
def test_380_사토장_토취장은_횡단_그림_3D_없음():
for type_id in KINDS:
row = catalog_row(type_id)
assert (row["station"], row["shape"], row["model3d"]) == ("none", "none", "none"), type_id
def test_54_7_사토장_기준_측점_꼴은_토취장과_같음_옛_구간은_기준_측점으로_읽음():
from B05_Profile.B05_Profile_Structures_Schema import StructureInstance
by_id = {t.type_id: t for t in load_structure_types()}
assert by_id["spoil_bank"].placement == by_id["borrow_pit"].placement == "site"
old = {"type_id": "spoil_bank", "placement": "interval", "start_m": 60, "end_m": 80}
for extra, station in (({"chainage_m": 70}, 70.0), ({}, 60.0)):
item = StructureInstance.model_validate({**old, **extra})
assert (item.placement, item.chainage_m, item.start_m, item.end_m) == (
"site",
station,
None,
None,
)