# -*- coding: utf-8 -*- """54-14 종단 구조물 알약 정보 라벨 — 중요한 것만. • 2행 — 1행 = 이름 + 기준 측점 · 2행 = 컨테이너마다 첫 옵션 값만 「 · 」 로 이음(54-46 · 제목 없음) • 컨테이너 = 좌측 패널 폼과 같은 상자(명세 컨테이너 · 선택 컨테이너는 인스턴스마다 · 정의 옵션 그룹) • 빈 값은 건너뜀 · 값 auto = 「(자동)」 · 값이 하나도 없으면 1행만 · 메모 · 그 밖 옵션은 안 씀 • 라벨은 ▲▼ 단추층 위 · 단추 높이만큼 위로 비킴 · B05 · B06 은 같은 레인 — 실제 화면은 ORCA 로 따로 본다. 화면 그릇 없이 Node 헬퍼가 TS 를 트랜스파일해 돌린다(`helper_54_14_balloon_lines.cjs`). """ import json import os import subprocess import pytest HERE = os.path.dirname(os.path.abspath(__file__)) ROOT = os.path.abspath(os.path.join(HERE, "..", "..")) MARKS = os.path.join(ROOT, "B05_Profile", "B05_Profile_UI_Structures_Marks.ts") STYLE = os.path.join(ROOT, "B05_Profile", "B05_Profile_UI_Style_Structures.css") @pytest.fixture(scope="module") def out(): proc = subprocess.run( ["node", os.path.join(HERE, "helper_54_14_balloon_lines.cjs")], capture_output=True, text=True, encoding="utf-8", timeout=60, ) assert proc.returncode == 0, proc.stderr return json.loads(proc.stdout) def test_배관_컨테이너마다_첫_값만_한_줄로_이음(out): # 흙막이 1 은 구조 칸 없음 — 형태(54-30) assert out["pipeFull"] == ["이름 5+0", "1200 · 집수정 · 흙막이 · 돌망태 · 도수로"] def test_빈_값은_건너뜀(out): assert out["pipeBlank"] == ["이름 5+0"] def test_흙막이_상자_수는_밖에서_정한_단_수(out): # 저장 1 벌(형태 빈 값) · 모자란 둘째도 빈 값 — 둘 다 건너뜀 assert out["pipeCount"] == ["이름 5+0"] def test_박스_본체_규격은_폭_높이로_되찾음(out): assert out["boxPreset"] == ["이름 5+0", "3.0 × 3.0 · 날개벽"] assert out["boxBlank"] == ["이름 5+0"] def test_정의_옵션_그룹은_그룹마다_첫_켜진_옵션(out): assert out["underdrain"] == ["이름 5+0", "0.6m"] assert out["underdrainBlank"] == ["이름 5+0"] # 끈 칸(높이)은 건너뜀 assert out["wall"] == ["이름 5+0"] assert out["wallAuto"] == ["이름 5+0", "(자동)"] def test_컨테이너가_없으면_1행만(out): assert out["mirror"] == ["이름 5+0"] assert out["etcEmpty"] == ["이름 5+0"] assert out["etcNote"] == ["이름 5+0", "시험 비고"] def test_라벨은_단추층_위로_비켜_뜬다(): with open(MARKS, encoding="utf-8") as handle: marks = handle.read() with open(STYLE, encoding="utf-8") as handle: style = handle.read() assert "EDIT_BUTTON_CLEARANCE_PX = 21" in marks assert "ROW_GAP_PX + EDIT_BUTTON_CLEARANCE_PX" in marks assert "balloonLines(" in marks and "structure.memo" not in marks lane = style.split(".b05-structure__lane {", 1)[1].split("}", 1)[0] assert "z-index" not in lane # 레인이 쌓임 층을 만들면 라벨이 그 안에 갇힘 balloon = style.split(".b05-structure__balloon {", 1)[1].split("}", 1)[0] assert balloon.count("z-index") == 1 and "z-index: 6;" in balloon