⚠ **뿌리** — `tmp/` 는 창 사이에 안 건너감(실측 확인: 상대 창이 놓은 `tmp/_sync_probe.txt` 가 시간을 두고 두 번 봐도 안 보임). 그래서 **정본(등록부 스키마)만 건너가고 그것을 읽는 시험은 안 건너가** 오늘 두 번, 같은 시험이 **연 창은 통과·받은 창은 실패**가 됐음. - `tmp/tests/*` 를 `resources/tester/` 로 **복사**(127 파일). 내용은 **한 줄도 안 고침** - `tmp/tests` 는 **남겨 둠** — 되돌릴 자리(사용자 지시) - 실행: `./venv/Scripts/python.exe -m pytest resources/tester/ -q` 옮기기 전과 **같은 수**: 617 통과 / 22 건너뜀 / 실패 0 ⇒ 이제 시험·예외·까닭이 **정본과 함께** 움직임. 오늘 세운 「예외는 정본 스키마에」와 짝임. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
64 lines
3.3 KiB
Python
64 lines
3.3 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"
|
|
_B06 = PROJECT_ROOT / "B06_Section" / "B06_Section_UI_Page_Structures_Panel.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: true" in _B06.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")
|
|
assert 'choices.unshift(["", "— 선택 —"])' in panel
|
|
assert 'option.required === true && (option.default ?? "") === ""' in panel
|
|
|
|
|
|
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))
|