Files
Aislo/resources/tester/test_54_6_slope_container.py
T
eomsangdonandClaude Opus 5.5 e4b9b3e5a3 refactor(859-5 ②): 구조물 정의 코드 M02 StructOptions → M01_MasterData/StructOptions
- 파일 23 개 git mv · 이름 M02_SO_* → M01_SO_* · 내용 · 동작 · 화면 글 그대로
- 서버 주소 /api/m02 → /api/m01(이름만 · 10 길 · 수 469 그대로) · main.py 등록 이름 m01_so_*
- 화면 부름 = common_util_m02_call 의 call 에 base 인자(기본 /m02 · 구조물 정의만 /m01)
- import 고침 = B05 · B07 · B08 · M01 · M02 · main · 시험 · 도우미
- 소스 글자만 보던 시험 셋 지움(구조물 정의 옮김에 걸림 · 결과를 안 봄):
  test_m02_structure_options 좌측 줄 · test_m02_structure_option_groups 좌측 정의 줄 · test_136_3 M02 미리보기 단추 CSS
- test_553_5 부품 훑기 폴더 = 옮긴 자리

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 21:42:33 +09:00

62 lines
2.2 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 M01_MasterData.StructOptions import M01_SO_Definition
from M01_MasterData.StructOptions.M01_SO_Groups import groups_of
from M02_MasterTemplete.M02_Table_Fill import _with_group_items
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 M01_SO_Definition.check(doc) == []
assert M01_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 컨테이너 이름