Files
Aislo/resources/tester/test_152_3_chute_cut.py
T
eomsangdonandClaude Opus 5.5 d1c863c05a test(152-3): 394-3 성토만 측점 기대 고침 — 371-1 의도된 바뀜(배관 85.052 끝 구간 묻힘 → 성토 + 3도 절토)
- 까닭 = 6ba26ee61(371-1 다단 사이 시작 = 윗단 발끝) · 그 앞 커밋 트리에서 helper 그대로 = fill · fill / 띠 2 · 2
- 아랫단 0.5 m 내려가 끝 구간 시작이 원지반 아래 → 152-3 3도 절토선 · 관 거름 띠 2 그대로 · 성토만 거름 1
- 제품 코드 고침 없음

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Se7ytqbohmBQnfYpwYFnYf
2026-10-17 18:52:16 +09:00

68 lines
2.9 KiB
Python

"""152-3 도수로 · 돌붙임 띠 — 묻힌 유출 끝 3도 절토선(내림 · 수평)에도 띠 · 오르막 복합경사 절토엔 없음.
화면 TS 를 그 자리에서 돌린 값(`helper_152_3_chute_cut.cjs`) · B06 관 · 흙막이 띠와 3D 띠가 같은 거름.
배관 85.052 = 371-1 뒤 아랫단 0.5 m 내려가 끝 구간이 묻힘 → 성토 + 3도 절토(의도된 바뀜 · 394-3).
"""
import json
import subprocess
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[2]
HELPER = Path(__file__).parent / "helper_152_3_chute_cut.cjs"
NODE_MODULES = ROOT / "config" / "node_modules"
pytestmark = pytest.mark.skipif(not NODE_MODULES.is_dir(), reason="프론트엔드 의존성 미설치")
@pytest.fixture(scope="module")
def out() -> 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_묻힌_흙막이_유출_3도_선에_띠(out: dict) -> None:
(cut,) = out["box"]["segments"]
assert cut["kind"] == "cut" and not cut["rises"]
assert cut["band"] and cut["topIsLine"] # 윗면 = 3도 선
assert cut["below"] == pytest.approx(0.3, abs=0.01) # 선 아래 두께
assert out["box"]["bands3d"] == 1 and out["box"]["bands3dFillOnly"] == 0
def test_배관_묻힌_끝_내림이면_띠_오르막이면_없음(out: dict) -> None:
down = out["pipeDown"]["segments"]
assert [s["kind"] for s in down] == ["fill", "cut"]
assert all(s["band"] for s in down)
up = out["pipeUp"]["segments"]
assert up[-1]["kind"] == "cut" and up[-1]["rises"] and not up[-1]["band"]
assert out["pipeDown"]["bands3d"] == 2 and out["pipeUp"]["bands3d"] == 1
def test_성토만인_측점은_그대로(out: dict) -> None:
base = out["pipeBase"]
assert [s["kind"] for s in base["segments"]] == ["fill", "cut"]
# 성토 조각 띠는 두 거름 같음 · 3도 절토 조각만 관 거름이 더함
assert base["bands3d"] == 2 and base["bands3dFillOnly"] == 1
def test_거름_한_벌_배선() -> None:
culvert = _src("B06_Section/B06_Section_UI_Cross_Culvert.ts")
assert "layout.outletFill.segments.filter(isChuteSegment)," in culvert
corridor = _src("B05_Profile/B05_Profile_UI_Corridor_Structures.ts")
flat = " ".join(corridor.split())
assert "chuteBands( layout.outletFill.segments, section.culvert?.chute, isChuteSegment," in flat
hatch = _src("B06_Section/B06_Section_UI_Cross_Wall_Hatch.ts")
assert '"3도 절토선"' in hatch
# 박스 · 세월교 본체 끝은 성토만(3도 규칙 안 넓힘)
for name in ("B06_Section_UI_Cross_Box.ts", "B06_Section_UI_Cross_Ford.ts"):
assert 'side.fillSegments.filter((s) => s.kind !== "cut")' in _src(f"B06_Section/{name}")