- 폼이 상자를 새로 세울 때마다(단 수 · 유입 형식 · 벽 조작 · 저장 · 넘김) 고른 상자 강조 다시(specpaint 한 곳) · 54-29 의 두 군데 호출 대체 - 관 보호공(유입 · 유출) 상자 안 [연동] [경사] 반 폭 두 단추 — 옛 연동 제어 값(revet_link_detached · revet_follow_grade) 그대로 · 쓸 수 있을 때만 활성 · 경사 끄면 연동 잠김 · 누르면 횡단 그림 바로 - 상자 칸을 고치거나 고르면 그 벽을 고름(횡단에서 누른 것과 같은 길 · 카드 다시 그림) · 단 수 칸은 고른 단을 지킴 - 추가 흙막이 상자 = 사면안정 흙막이와 같은 칸(형태 · 길이 · 높이 · 전 · 후) · 구조 고르기 칸과 정의 이름 두 줄 뺌 · 저장 키 그대로 - 시험 54-29 · 54-27 · 52 명세 · 54-14 말풍선 기대값 맞춤 화면 확인(sub5_검증 12+18): 흙막이 1 강조 = 단 2→1 · 넘김 · 저장 뒤 유지 · 형태 고침 → 상자 · 벽 강조 · 경사 끔 → 13+0 벽 이동 · 두 줄 함께 · 목록 대 횡단 같은 글(칸 54) · 단 0 저장으로 되돌림 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
81 lines
3.0 KiB
Python
81 lines
3.0 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:
|
|
"""54-30 — 사면안정 흙막이와 같은 칸(형태 · 길이 · 높이 · 전 · 후) · 구조 고르기 없음."""
|
|
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
|