Files
Aislo/resources/tester/test_54_6_slope_container.py
T
eomsangdonandClaude Opus 5.5 00dfd7f814 feat(structure): 사면안정(C군) 종류마다 컨테이너 「상세 내용」 · 그 안 구조물 조합 잇기(54-6)
- 옹벽 · 돌쌓기(찰) · 돌쌓기(메) · 흙막이 · 큰돌쌓기 · 소단 = 정의 그룹 「상세 내용」 하나에 옵션 전부(기준 측점 · 측점 범위 밖) · 칸 차례 그대로
- 잇기 = group_items(그룹 id) · 종류 단위 잇기 줄은 가림(그룹 있는 종류 규칙)
- 옛 종류 단위 잇기(summary_item)는 첫 그룹 컨테이너 잇기로 읽음 · [수정]·[저장] 때 group_items 로 옮겨 저장
- 저장 값 · 옵션 키 · 횡단 · 사면 · 집계 계산 그대로 · 정의 판 13 · 이력 판_12
- 시험 test_54_6_slope_container · ui_checks/54-6_사면안정_컨테이너(C군 6종 · B05 = B06 · 저장 → 다시 열기 · 되돌림)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt
2026-10-06 10:33:38 +09:00

59 lines
2.1 KiB
Python

"""PLAN 54-6 — 사면안정(C군) 종류마다 컨테이너 「상세 내용」(정의 그룹) 하나.
· 기준 측점(측점 범위) 밖 옵션 전부를 담음 · 옵션 키 · 차례 그대로
· 잇기 = 그룹 id(`group_items`) — 종류 단위 잇기 줄은 가림(hidesTypeSummary = 그룹 있음)
"""
import json
from pathlib import Path
from B05_Profile.B05_Profile_Structures_Schema import DEFINITION_PATH, load_structure_types
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 = {
"retaining_wall": "gretaindetail",
"masonry_wet": "gmasonwetdetail",
"masonry_dry": "gmasondrydetail",
"soil_guard": "gsoilgdetail",
"boulder_masonry": "gboulderdetail",
"berm": "gbermdetail",
}
def test_C군_종류마다_컨테이너_하나_옵션_전부():
types = [t for t in load_structure_types() if t.group == "C"]
assert sorted(t.type_id for t in types) == sorted(KINDS)
groups = groups_of()
for item in types:
assert groups[item.type_id] == [
{
"id": KINDS[item.type_id],
"name": "상세 내용",
"options": [o.key for o in item.options],
}
]
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 = {"layer": "system", "owner": None, "key": "SS000001", "name": "옹벽"}
rows = _with_group_items(
[
{
"type_id": "retaining_wall",
"복사본": "s1",
"summary_item": None,
"group_items": {"gretaindetail": link},
}
]
)
assert [r["복사본"] for r in rows] == ["s1", "s1__gretaindetail"]
assert rows[1]["summary_item"] == link and rows[1]["그룹"] == "상세 내용"