- logic 새 파일 9 — B06_Section_Cross_Culvert · _Culvert_Geom · _Culvert_Extra · _Culvert_Tiers · _Culvert_Types · _Culvert_Wire · _Box_Geom · _Ford_Geom · _Ford_Pavement - 그림 파일(UI_Cross_Culvert · _Culvert_Types · _Box · _Ford · _Ford_Pavement)은 받은 좌표로 그리기만 · 관 겹 꼭짓점(pipeShellCorners) · 물넘이 노면 끝 · 월류선 · 유출 성토선은 logic 으로 - 옛 순수 기하 6 파일(UI_Cross_Culvert_Geom · _Extra · _Tiers · _Wire · _Box_Geom · _Ford_Geom) 지움 · 부르는 쪽(B05 Corridor · Structure_Layouts · Route_Carry_Patch · Wall 등)은 import 줄만 - test_472_3 GEOMETRY_PULLS 자기 11 줄 + 더는 안 끌리는 Design_Surface 1 줄 걷음 - 시험 · helper 경로를 새 logic 파일로 — 옮긴 파일을 가리키던 낡은 경로 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56 lines
2.3 KiB
Python
56 lines
2.3 KiB
Python
"""152-2 연동 흙막이 높이 — 본 흙막이가 그린 순수 높이를 옆 카드가 물려받음 · 풀면 그 측점만 따로.
|
|
|
|
화면 TS 를 그 자리에서 돌린 값(`helper_152_2_link_height.cjs`) · 픽스처 = 73-4(박스 352.14 · 높이 칸 비움).
|
|
"""
|
|
|
|
import json
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
HELPER = Path(__file__).parent / "helper_152_2_link_height.cjs"
|
|
NODE_MODULES = ROOT / "config" / "node_modules"
|
|
|
|
pytestmark = pytest.mark.skipif(not NODE_MODULES.is_dir(), reason="프론트엔드 의존성 미설치")
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def screen() -> dict:
|
|
done = subprocess.run( # noqa: S603 — 고정 실행 파일
|
|
["node", str(HELPER)], cwd=str(ROOT), capture_output=True, text=True, encoding="utf-8"
|
|
)
|
|
assert done.returncode == 0, done.stderr
|
|
return json.loads(done.stdout)
|
|
|
|
|
|
def _src(relative: str) -> str:
|
|
return (ROOT / relative).read_text(encoding="utf-8")
|
|
|
|
|
|
def test_연동_옆_카드_높이_본_흙막이와_같음(screen: dict) -> None:
|
|
owner = screen["owner"]["pure"]
|
|
assert owner == {"inlet": 2.0, "outlet": 2.0} # 본체 끝 높이(근입 0.5 아님)
|
|
for chainage in ("340", "360"):
|
|
assert screen["linked"][chainage]["pure"] == owner
|
|
assert screen["linked"][chainage]["walls"] == screen["owner"]["walls"]
|
|
|
|
|
|
def test_연동_풀린_카드만_따로(screen: dict) -> None:
|
|
detached = screen["detached"]
|
|
assert detached["340"]["pure"] == {"inlet": 2.0, "outlet": 2.1}
|
|
assert detached["360"]["pure"] == {"inlet": 2.0, "outlet": 2.0}
|
|
assert detached["owner"]["pure"] == {"inlet": 2.0, "outlet": 2.0}
|
|
|
|
|
|
def test_풀린_카드_이_측점_높이_줄() -> None:
|
|
panel = _src("B06_Section/B06_Section_UI_Cross_Structure_Panel.ts")
|
|
assert "deps.linkState()?.linked === false && guardKey && !isBasin" in panel
|
|
assert '"이 측점 높이"' in panel
|
|
dock = _src("B06_Section/B06_Section_UI_Adjust_Dock.ts")
|
|
assert 'const OWN_HEIGHT_ROW = ".b06-structure-panel__struct--own-height";' in dock
|
|
assert "return OWN_HEIGHT_ROW;" in dock # 세월교 · 박스 날개벽 칸도 받음
|
|
wire = _src("B06_Section/logic/B06_Section_Cross_Culvert_Wire.ts")
|
|
assert "h: shift.inlet.h ?? heights.inlet" in wire
|