Files
Aislo/resources/tester/test_73_4_body_guard.py
T
eomsangdonandClaude Opus 5.5 210ff06dee refactor(511-B B-6 옛 server-calc 묶음 걷음): 운영 부름 0 · 시험 대조만이던 옛 묶음 걷음 — 걷기 전용 커밋(되돌리기 = 이 커밋 revert)
걷은 것
- B06_Section/B06_Section_Server_Calc_Node.ts 통째(135 줄 · 입구 · haul_plan_for 갈래 · 면적 · 유토곡선 · 다단 벽)
- package.json:8 build 안 「&& npm run build:server-calc」 · package.json:10 「build:server-calc」 줄
- B06_Section/B06_Section_Server_Calc_Prebuild.py:61 ROOT · :62-63 옛 묶음 주석 · BUNDLE · :66 _NPM_SCRIPT
- 지어진 묶음 config/server_calc_node/B06_Section_Server_Calc_Node.js = git 밖(.gitignore:63-64 그대로) · 폴더마다 찌꺼기 남음

시험 옮김(새 입구 = Prebuild._run_node · 등록부 Node design_calc_node)
- 110 · 120 · 131 · 73_4 · 178_1 · helper_472_1_paths = _run_node
- b06_ground_unlock · height_unlock = design_calc_node.js 판 검사(build:design-calc)
- 472_3 registry · runner = 옛 묶음 대조 → Node 입구 정본 값 · 늘 떠 있는 Node = 새 프로세스
- 511_c = 옛 대 새 대조 → 새 Node = 브라우저 TS(computeHaulPlan · structureAreaRows · extraWallRows)
- haul_plan_quantity_unpruned = 새 입구 · /haul-plan 그림 갈래 글 검사 · server_calc_node.mjs = design_calc_node structure.layouts
- 글만: Schema · HaulPlan · design_calc_node 주석 · B06 CLAUDE.md · 시험 셋 머리

검증: 고친 시험 15 파일 87 통과 · typecheck 0 — 요구 320-4 · 322

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:17:45 +09:00

84 lines
3.7 KiB
Python

"""73-4 세월교 · 박스 흙막이 — 관보호공 흙막이와 같은 벽 · 같은 자리 규칙(관 · 본체 끝).
화면 TS 를 그 자리에서 돌린 값(`helper_73_4_body_guard.cjs`)과 서버 Node 번들(면적)을 대조함.
픽스처 = 검증_sub7 상세 일부(세월교 173.09 유입 · 유출 흙막이 · 박스 352.14 유입 · 유출 흙막이 전후 15 · 10 m).
"""
import json
import subprocess
import sys
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[2]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
HELPER = Path(__file__).parent / "helper_73_4_body_guard.cjs"
FIXTURE = Path(__file__).parent / "fixtures" / "b06_73_4_body_guard_sections.json"
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 test_박스_벽_배면이_본체_끝_윗면이_본체_윗면(screen: dict) -> None:
walls = screen["box"]["walls"]
assert {w["role"] for w in walls} == {"inlet", "outlet"}
for wall in walls:
assert wall["dOffset"] == pytest.approx(0, abs=1e-3)
assert wall["dElevation"] == pytest.approx(0, abs=1e-3)
# 형태 = 폼 값 그대로(유입 찰 · 유출 콘크리트)
assert {w["role"]: w["form"] for w in walls} == {"inlet": "돌쌓기(찰)", "outlet": "콘크리트"}
# 자동 자리 = 본체 기준 0 — 되받아 저장해도 본체를 따라감
assert screen["box"]["applied"] == {"inlet": 0, "outlet": 0}
def test_박스를_늘리면_벽도_m_단위로_따라감(screen: dict) -> None:
before = {w["role"]: w["front"] for w in screen["box"]["walls"]}
for wall in screen["boxMoved"]:
assert wall["dOffset"] == pytest.approx(0, abs=1e-3)
assert abs(wall["front"] - before[wall["role"]]) == pytest.approx(1.0, abs=1e-3)
def test_세월교_벽_배면이_관_끝(screen: dict) -> None:
walls = {w["role"]: w for w in screen["ford"]["walls"]}
# 유출은 관 1 m 맞춤만큼 바깥으로 물러남(80 · test_80_ford_pipe) — 1 m 안
assert abs(walls["outlet"]["dOffset"]) < 1
assert walls["outlet"]["dElevation"] == pytest.approx(0, abs=1e-3)
assert walls["inlet"]["dOffset"] == pytest.approx(0, abs=1e-3)
# 윗면 = 측벽 상단(상판 높이) — 노면 위로는 안 솟음(79-7)
assert walls["inlet"]["dElevation"] <= 1e-3
def test_연동_옆_측점에도_벽이_섬(screen: dict) -> None:
assert [row["walls"] for row in screen["linked"]] == [2, 2]
def test_설계선_트림은_흙막이_쪽(screen: dict) -> None:
assert screen["box"]["trimSame"] and screen["ford"]["trimSame"]
def test_서버_면적이_화면과_같음(screen: dict) -> None:
from B06_Section.B06_Section_Server_Calc_Prebuild import _run_node
sections = json.loads(FIXTURE.read_text(encoding="utf-8"))["cross_sections"]
output = _run_node({"detail": {"cross_sections": sections}})
assert output, "서버 Node 번들 실행 실패"
server = {round(r["chainage_m"], 2): r for r in output["areas"]}
for row in screen["areas"]:
mine = server[round(row["chainage_m"], 2)]
for key in ("cut_area_m2", "fill_area_m2"):
assert mine[key] == pytest.approx(row[key], abs=1e-4), (row["chainage_m"], key)
# 세월교 · 박스 흙막이 세트는 관이 아님 — 관 연장 안 실음
assert all("pipe_length_m" not in r for r in screen["areas"])