Files
Aislo/resources/tester/test_136_chute_form_cache.py
T
eomsangdonandClaude Opus 5.5 b66dce4313 feat(B06): 도수로 · 돌붙임 실시간 반영 · 물넘이 포장 chute 연결(136-1 · 136-2)
- 폼 → 횡단 캐시 한 곳(applyPipeOptionsToCache)에서 관 · BOX · 세월교 · 물넘이 포장 chute 갈아 끼움 + 카드 다시 그림
- chute(values, 머리) · _chute 같은 인자 · 물넘이 세트에 ford_chute_{n}_* (파이썬 · TS 짝)
- 물넘이 오버레이에 유출측 성토사면 띠 · B08 집계 gfordpavechute 같은 열
- 시험: test_136_chute_form_cache 새로 · 거울 · test_52_3 · test_120 늘림

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015sDZSjFvoiDjdGpgj3muc3
2026-10-09 14:49:41 +09:00

56 lines
2.1 KiB
Python

"""136-1 폼 → 캐시 chute — 좌측 패널 도수로/돌붙임 상자가 [저장] 전에 횡단 제원에 바로 얹힘.
관 · BOX(폭 걸친 측점 둘) · 세월교 · 물넘이 포장(`ford_chute_*`) · 지움 · 일부만 온 되얹기.
화면 TS 를 그 자리에서 돌린 값(`helper_136_chute_form_cache.cjs`).
"""
import json
import subprocess
from pathlib import Path
import pytest
HERE = Path(__file__).parent
ROOT = HERE.parents[1]
pytestmark = pytest.mark.skipif(
not (ROOT / "config" / "node_modules").is_dir(), reason="프론트엔드 의존성 미설치"
)
@pytest.fixture(scope="module")
def out() -> dict:
done = subprocess.run( # noqa: S603 — 고정 실행 파일
["node", str(HERE / "helper_136_chute_form_cache.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
)
assert done.returncode == 0, done.stderr
return json.loads(done.stdout)
def test_관_상자_넣으면_바로_chute_와_카드(out: dict) -> None:
assert out["pipeAdd"]["pipe"] == {"structure": "돌붙임", "thickness_m": 0.4}
assert 85 in out["pipeAdd"]["refreshed"]
# 같은 값이면 chute 때문에 다시 그리진 않음(관 길의 카드 갱신만)
assert out["pipeSame"]["pipe"] == out["pipeAdd"]["pipe"]
def test_되얹기는_상자_없으면_그대로_칸_전부면_지움(out: dict) -> None:
assert out["replayNoChute"]["pipe"] == {"structure": "돌붙임", "thickness_m": 0.4}
assert out["pipeRemove"]["pipe"] is None
def test_박스는_걸친_측점_모두_세월교도(out: dict) -> None:
assert out["boxAdd"]["box"] == [{"structure": "도수로", "thickness_m": 0.3}] * 2
assert {118, 120} <= set(out["boxAdd"]["refreshed"])
assert out["fordAdd"]["ford"] == {"structure": "돌붙임", "thickness_m": 0.5}
assert out["fordAdd"]["refreshed"] == [160]
# 다른 관 지점은 안 건드림
assert out["fordAdd"]["pipe"] is None and out["fordAdd"]["box"][0] is not None
def test_물넘이_포장은_ford_chute_만(out: dict) -> None:
assert out["paveAdd"]["pave"] == [{"structure": "돌붙임", "thickness_m": 0.3}] * 2
assert out["paveAdd"]["refreshed"] == [196, 200]