"""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", } TABLE_09 = {"soil_guard", "retaining_wall", "berm"} 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: if item.type_id in TABLE_09: # 표 09 로 바뀜 — test_54_26_slope_table09 continue 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]["그룹"] == "옹벽" # 표 09 컨테이너 이름