- 배관 유입 · 유출 칸에 횡단 전용 줄(옵션 · 경사 · 읽기) 안 옮김 · 이름표 꼬리 「(기슭막이(유출))」 뺌 - 배관 유입 벽 「추가 기슭막이(단) 0단」 줄 숨김(선 단이 있을 때만) · 집수정 내공 줄만 남김 - 폼을 다시 그린 뒤(유입 형식 되싣기 · 단 수 · 벽 조작) 고른 상자 강조 다시 — 흙막이 상자 강조 빠짐 고침 - 시험 test_54_29_pick_same_panel · test_54_27 단 줄 단언 새 형태로 화면 확인(sub5_검증 12+18 단 1): 유출 · 흙막이 1 · 유입 목록 대 횡단 innerText · 칸 67 · 값 같음 · 강조 상자 하나만 · B05 넘김 같음 · 유출 5칸 → 관 길이 15 → 20 · 되돌림 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
80 lines
2.9 KiB
Python
80 lines
2.9 KiB
Python
"""배관 유출 「추가 흙막이(단)」 칸 (PLAN 54-27).
|
|
|
|
짝: `B05_Profile/B05_Profile_UI_Drainage_Facility.ts`(유출 상자 안 단 칸 · 흙막이 상자 구조 「흙막이 (기본)」) ·
|
|
`A00_Common/design/design_structure_pipe_calc.ts`(`setPipeExtraCount` = 횡단 조정 단 수와 같은 자리).
|
|
실제 TS 를 `helper_54_27_soil_tier_field.cjs` 가 Node 로 돌린다.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
|
|
import pytest
|
|
|
|
HERE = os.path.dirname(__file__)
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def out() -> dict:
|
|
proc = subprocess.run( # noqa: S603 — 고정 실행 파일
|
|
["node", os.path.join(HERE, "helper_54_27_soil_tier_field.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) -> None:
|
|
assert out["label"] == "추가 흙막이(단)"
|
|
assert out["start"] == {"value": "0", "boxes": 0, "structures": []}
|
|
|
|
|
|
def test_단_수_N_이면_흙막이_상자_N(out) -> None:
|
|
assert (out["set2"]["value"], out["set2"]["boxes"]) == ("2", 2)
|
|
assert (out["set1"]["value"], out["set1"]["boxes"]) == ("1", 1)
|
|
assert (out["set0"]["value"], out["set0"]["boxes"]) == ("0", 0)
|
|
|
|
|
|
def test_지형_한도를_넘으면_세운_만큼(out) -> None:
|
|
assert (out["set5"]["value"], out["set5"]["boxes"]) == ("2", 2)
|
|
|
|
|
|
def test_좌측_칸은_횡단_단_수_자리에_씀(out) -> None:
|
|
assert out["writes"] == [[100, 2], [100, 1], [100, 5], [100, 0]]
|
|
|
|
|
|
def test_횡단에서_바꾸면_좌측_칸이_따라감(out) -> None:
|
|
assert (out["fromCross"]["value"], out["fromCross"]["boxes"]) == ("2", 2)
|
|
|
|
|
|
def test_늘어난_흙막이_상자_구조는_흙막이_기본(out) -> None:
|
|
assert out["set2"]["structures"] == ["흙막이 (기본)", "흙막이 (기본)"]
|
|
|
|
|
|
def test_흙막이_아닌_구조면_칸을_가림(out) -> None:
|
|
assert out["otherHidden"] is True
|
|
|
|
|
|
def _src(rel: str) -> str:
|
|
with open(os.path.join(HERE, "..", "..", rel), encoding="utf-8") as f:
|
|
return f.read()
|
|
|
|
|
|
def test_자동_자리_읽기_글이_없음() -> None:
|
|
"""54-28 — 관 길이 · 좌우 바깥 · 상하(사면) 자동 자리 글을 만드는 뿌리(문구 · 줄)가 없음."""
|
|
locale = _src("ui_template/ui_template_locale_b2.ts")
|
|
for key in ("B06_Cross_Revet_Auto", "B06_Cross_Revet_Pipe", "B06_Cross_Lateral_Label"):
|
|
assert key not in locale
|
|
assert "lateralLine" not in _src("B06_Section/B06_Section_UI_Cross_Structure_Panel.ts")
|
|
|
|
|
|
def test_배관_유출_칸은_옛_단_수_줄을_안_받음() -> None:
|
|
dock = _src("B06_Section/B06_Section_UI_Adjust_Dock.ts")
|
|
# 54-29 — 배관 유출 칸 = 집수정 내공 줄만(단 수 · 읽기 · 옵션 줄 안 받음)
|
|
assert 'const PIPE_OUTLET_ROWS = ".b06-structure-panel__struct--basin-size";' in dock
|