Files
Aislo/resources/tester/test_178_1_slope_wall_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

86 lines
3.6 KiB
Python

"""178-1 사면안정 벽(흙막이 · 옹벽) 가드 한 벌 — 카드 · 서버 면적 · B07 · 3D.
흠: 카드는 「연동 관 벽이 이 측점에 실제로 설 때만」 독립 벽을 건너뛰는데, 서버 면적
(`computeStoredLayouts` → Node) · B07 은 링크만 있어도 건너뛰고 3D 는 관 측점만 봤다.
⇒ 관 링크는 있으나 관 벽이 안 서는 측점에서 카드엔 흙막이가 서고 서버 면적 · B07 엔 없음.
고침: `ownWallsDrawAt` 한 벌을 세 곳이 함께 씀. 서버 면적은 같은 TS 를 Node 로 돌리므로
[저장] 재계산 Node 입구(`_run_node`) 결과로 판정한다.
"""
import copy
import json
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[2]
VITE = ROOT / "config" / "node_modules" / "vite" / "bin" / "vite.js"
FIXTURE = ROOT / "resources" / "tester" / "fixtures" / "b06_73_4_body_guard_sections.json"
SOIL_GUARD = {
"structure_id": "w1",
"type_id": "soil_guard",
"name": "흙막이",
"start_m": 150,
"end_m": 370,
"anchor_m": 260,
"form": "돌쌓기(찰)",
"height_m": 1.5,
}
@pytest.fixture(scope="module")
def bundle():
"""서버 면적 = [저장] 재계산 Node 입구(`_run_node` · 옛 server-calc 묶음 = 511-B B-6 걷음)."""
if not VITE.is_file():
pytest.skip("프론트엔드 의존성 미설치")
from B06_Section.B06_Section_Server_Calc_Prebuild import _run_node
return _run_node
def _areas(bundle, sections: list, tmp_path: Path) -> dict[float, tuple]:
rows = bundle({"detail": {"cross_sections": sections}})["areas"]
return {row["chainage_m"]: (row["cut_area_m2"], row["fill_area_m2"]) for row in rows}
def _sections() -> list:
return copy.deepcopy(json.loads(FIXTURE.read_text(encoding="utf-8"))["cross_sections"])
def test_링크만_있고_관_벽이_안_서면_흙막이_면적_행이_나온다(bundle, tmp_path):
"""173.087 관의 다단 구간값(20 m)이 160 · 180 을 덮어 링크는 서지만 관 벽(전 · 후 5 m)은 안 섬."""
sections = [s for s in _sections() if s["chainage_m"] < 300]
sections[1]["design"]["extra_spans"] = {"extra0": {"before_m": 20, "after_m": 20}}
for section in sections:
if not section.get("culvert"):
section["revetment"] = SOIL_GUARD
areas = _areas(bundle, sections, tmp_path)
assert 160 in areas and 180 in areas, f"흙막이가 선 측점 면적 행 없음: {sorted(areas)}"
# 표준 성토(160 = 1.45 · 180 = 5.32 ㎡)보다 벽이 사면을 끊어 줄어듦
assert areas[160][1] < 1.45 and areas[180][1] < 5.32
def test_관_벽이_서는_측점은_독립_벽을_안_그린다(bundle, tmp_path):
"""340 · 360 은 352.14 관 벽이 섬 — 흙막이를 얹어도 면적이 관 벽 그대로(겹쳐 그리지 않음)."""
plain = _areas(bundle, _sections(), tmp_path)
walled = _sections()
for section in walled:
if not section.get("culvert"):
section["revetment"] = SOIL_GUARD
areas = _areas(bundle, walled, tmp_path)
assert areas[340] == plain[340] and areas[360] == plain[360]
def test_카드_서버_3D_가_가드_한_벌을_쓴다():
files = {
"카드": ROOT / "B06_Section" / "B06_Section_UI_Cross_View.ts",
"서버 면적 · B07": ROOT / "B06_Section" / "B06_Section_Structure_Layouts.ts",
"3D": ROOT / "B05_Profile" / "B05_Profile_UI_Corridor_Structures.ts",
}
for where, path in files.items():
source = path.read_text(encoding="utf-8")
assert "ownWallsDrawAt(" in source, f"{where} 가 가드 한 벌을 안 씀"
assert "culvertWallsStandAt(" not in source, f"{where} 에 따로 가드가 남음"