Files
Aislo/resources/tester/test_b06_detail_options.py
T
eomsangdonandClaude Opus 5.5 baa2438116 test(structure): 73-10 옛 기대값 정리 — 세월교 련 2 · 물넘이 경사각 3° · 내공 줄 숨김 · 관경 빈 배관 · 필수 칸 빈 보기
- test_b06_ford_set: 정의 기본 2련(65-4) · 소유 측점 붙기 = 관경 적은 배관으로(54-39 관경 빈 값 = 관 없음)
- test_b06_pavement_and_ford · test_b06_facility_default_notes: 경사각 빈 값 = 정의 기본 3° → % · 「경사각 3」 기본값 목록(65-5 · 66-2)
- test_b06_adjust_single_form: 집수정 내공 줄 화면 숨김(54-40)
- test_b06_detail_options: optionControl 셋째 인자(52-12) · 필수 · 기본값 칸 빈 보기 없음(54-43)
- 코드 그대로 · 대상 77 파일 394 통과 2 건너뜀

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
2026-10-07 08:30:41 +09:00

75 lines
4.2 KiB
Python

"""상세 제원(뒷길이·돌규격·형식)을 **B06 에서 받는지** — 2026-09-08 데스크탑 창 보고.
무슨 일이었나 — 레지스트리는 그 칸들을 `phase: "detail"` 로 두고 「B05 는 유무·종류·위치만,
상세 치수는 B06/B07 에서」(2026-08-17 사용자 확정)로 갈라 놓았는데, **그 화면이 아직 안 받고
있었다.** 그래서 실무 프로젝트의 구조물 옵션에 `back_len_cm`·`stone_cm`·`form` 이 통째로 비어
있었고, **수량이 품셈 갈래를 못 골라** 금액이 0 으로 남았다(13-4 돌쌓기 뒷길이 · 13-6 큰돌쌓기
직경 · 12-3 옹벽 형식).
고침 — 폼이 `includeDetail` 을 받아 **B06 에서만** 상세 칸까지 그린다. B05 는 종전 그대로다.
"""
import sys
from pathlib import Path
PROJECT_ROOT = Path(__file__).resolve().parents[2]
if str(PROJECT_ROOT) not in sys.path:
sys.path.insert(0, str(PROJECT_ROOT))
from B05_Profile.B05_Profile_Structures_Schema import load_structure_types # noqa: E402
_PANEL = PROJECT_ROOT / "B05_Profile" / "B05_Profile_UI_Structures_Panel.ts"
# 옵션 칸 그리기는 700줄 제한으로 이 조각으로 옮겨 감(2026-09-29 · PLAN 21-4)
_PANEL_OPTIONS = PROJECT_ROOT / "B05_Profile" / "B05_Profile_UI_Structures_Panel_Options.ts"
# 폼은 두 보기가 한 벌을 쓴다 — 상세 칸은 한 벌이 보기에 따라 그린다(계획서 24-3b).
_SHARED = PROJECT_ROOT / "A00_Common" / "design" / "design_shared.ts"
_B05 = PROJECT_ROOT / "B05_Profile" / "B05_Profile_UI_Panel.ts"
def _type(type_id: str):
return next(item for item in load_structure_types() if item.type_id == type_id)
def test_B06_은_상세_칸까지_받는다():
assert 'includeDetail: () => shared.view() === "cross"' in _SHARED.read_text(encoding="utf-8")
# 그릴 때마다 지금 보기로 가린다 — 만들 때 한 번 굳히면 한 벌 폼이 보기를 못 따라간다.
assert 'typeof detail === "function" ? detail()' in _PANEL.read_text(encoding="utf-8")
def test_B05_는_종전대로_유무_종류_위치만():
"""2026-08-17 사용자 확정 — B05 폼에 상세 칸이 생기면 안 된다."""
assert "includeDetail" not in _B05.read_text(encoding="utf-8")
def test_기본값_없는_필수_항목은_빈_칸으로_연다():
"""첫 항목을 슬쩍 고르면 **근거 없는 값**(뒷길이 25㎝ 같은)이 수량·단가로 흘러간다."""
panel = _PANEL.read_text(encoding="utf-8") + _PANEL_OPTIONS.read_text(encoding="utf-8")
fields = (PROJECT_ROOT / "B05_Profile" / "B05_Profile_UI_Structures_Fields.ts").read_text(
encoding="utf-8"
)
# 칸 만들기 = `optionControl` · 값은 저장 값만(52-12 셋째 인자 = 정의 이름).
# 54-43 — 필수 · 기본값 있는 칸은 빈 보기 없음 · 그 밖은 빈 글 빈 보기(「— 선택 —」 글 걷음).
assert "optionControl(option, values[option.key]" in panel
assert 'const must = !!option.required || fallback !== ""' in fields
assert '...(must ? [] : [["", ""]' in fields
def test_큰돌쌓기에_메_찰_구분이_있다():
"""품셈이 13-6-1 메쌓기 / 13-6-2 찰쌓기로 갈라 두는데 구분 칸이 없어 못 골랐다
(2026-09-08 데스크탑 창 요청). 돌쌓기는 이미 타입이 갈려 있다(찰/메)."""
bond = next(o for o in _type("boulder_masonry").options if o.key == "bond")
assert bond.choices == ["메쌓기", "찰쌓기"]
assert bond.default is None, "기본값을 두면 안 된다 — 설계자가 고를 값이다"
assert bond.required is True
assert bond.phase == "detail", "상세 제원이라 B06/B07 에서 받는다"
def test_규격_축이_타입마다_다르다():
"""⚠ 큰돌쌓기는 **직경**(13-6), 돌쌓기는 **뒷길이**(13-4) — 섞으면 엉뚱한 계수로 돈다
(2026-09-08 데스크탑 창이 실제로 그 결함을 잡았다)."""
stone = next(o for o in _type("boulder_masonry").options if o.key == "stone_cm")
back = next(o for o in _type("masonry_wet").options if o.key == "back_len_cm")
assert stone.choices == ["40~60", "60~80", "80~100"], "큰돌쌓기 = 직경 축"
assert "35" in back.choices and "75" in back.choices, "돌쌓기 = 뒷길이 축"
assert set(stone.choices).isdisjoint(set(back.choices))