Files
Aislo/resources/tester/test_472_open_no_draft.py
T
eomsangdonandClaude Opus 5.5 403722e687 refactor(B05·B06): 소단 = 옹벽처럼 측점에 제원 얹음 — 형상 얹기 한 벌 · 세션 사본 berm 걷음 (PLAN 577-2 · 요구 434 · 437)
- 얹기: attachShapes · attach_shapes 에 소단(section.berm · 덮는 소단 없음 = null) · SHAPE_KEYS 에 berm · TS attachBermSpecs ↔ 파이썬 attach_berm_specs · berm_spans_from 짝
- 읽기: 저장 노선 다시 셈(브라우저 · Node cross.refresh) = 얹힌 section.berm(칸 없음 = 저장분 design.berm) · 노선 초안 · 서버 Node 묶음 cross = crossWithShapes 의 얹힌 제원(bermAt · crossWithBerm 걷음)
- 계단은 계산 안쪽 그대로 · [저장] 길(구조물 정본 → cross.berm_spans) 그대로
- 지움: 시설 줄 syncBerm · putBerm(C4.copy) · writeBermSpans · 세션 칸 berm · bermRequest · design_shared bermAt
- 시험: test_272_berm_source 측점 얹기 거울로 · test_323_4 소단 얹음 · 477 · 511-A · 472 떠남 · 365 · 272 고름 헬퍼가 사본 대신 얹힌 소단 · design_pipeline_page 700 줄 → 699(주석 한 줄)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 11:33:06 +09:00

110 lines
3.5 KiB
Python

# -*- coding: utf-8 -*-
"""472 덧(요구 272 C · D) — B06 를 열기만 해도 초안이 생기던 흠 ·
카드 고름이 안 바꾼 지반을 박던 흠.
까닭
C. 표준 횡단 패널이 열 때 세션 `std-cross` 에 config 기본값을, 설정값 받기(`seedStandardCross`)가
저장분을 베껴 씀 → 조작 없이 초안 칸이 섬. 규칙 = 값이 저장분과 같으면 칸 없음 · 계산은 저장분.
D. 카드 단추 하나를 눌러도 지반 · 단면 유형 · 측구형식 · 포장 등 일곱 칸을 통째로 세션에 실음 →
[측구] 만 눌렀는데 ripping_rock 이 사용자 선택으로 박힘. 규칙 = 바꾼 칸만.
덧. 소단 사본(`berm` · 시설 줄이 열 때 구조물에서 씀)이 떠남 확인 고침으로 잡힘 →
소단 있는 프로젝트는 열기만 해도 물음.
Node 헬퍼 `helper_472_open_no_draft.mjs` 가 vite ssr 로 묶은 진짜 모듈
(`helper_472_open_no_draft_entry.ts`)을 부름.
"""
import json
import shutil
import subprocess
from pathlib import Path
import pytest
HERE = Path(__file__).resolve().parent
ROOT = HERE.parents[1]
FIXTURE = HERE / "fixtures" / "b06_364_6_rock_route_304.json"
@pytest.fixture(scope="module")
def out(tmp_path_factory):
work = tmp_path_factory.mktemp("b472_open")
build = subprocess.run(
[
"node",
str(ROOT / "config" / "node_modules" / "vite" / "bin" / "vite.js"),
"build",
"--configLoader",
"runner",
"--ssr",
"../resources/tester/helper_472_open_no_draft_entry.ts",
"--outDir",
str(work),
"--logLevel",
"error",
],
cwd=ROOT,
capture_output=True,
text=True,
encoding="utf-8",
timeout=300,
)
assert build.returncode == 0, build.stderr
bundle = work / "bundle.mjs"
shutil.copy(work / "helper_472_open_no_draft_entry.js", bundle)
proc = subprocess.run(
["node", str(HERE / "helper_472_open_no_draft.mjs"), str(bundle), str(FIXTURE)],
cwd=ROOT,
capture_output=True,
text=True,
encoding="utf-8",
timeout=120,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
@pytest.mark.parametrize("step", ["ctxDrafts", "panelDrafts", "afterStored", "configDrafts"])
def test_열기만_하면_초안_칸_0(step, out):
assert out[step] == []
def test_계산은_저장분(out):
assert out["panelRockDitch"] == 0.9
assert out["effectiveRockDitch"] == 0.9
def test_저장분_없으면_config(out):
assert out["configRockDitch"] == 0.69
def test_옛_판이_남긴_같은_값_칸은_걷음(out):
assert out["oldSameCell"] is None
def test_고친_값은_칸에_남음(out):
assert out["editedRoadWidth"] == 3.5
def test_카드_지반_글_상태는_상세_ground_type(out):
# 상세 = ripping_rock → 「토사」 단추 꺼짐(단추 이름은 늘 「토사」 · 켜짐/꺼짐이 값)
assert out["soilPressed"] == "false"
def test_측구_단추는_측구_칸만(out):
assert out["ditchChange"] == {"ditch_choice": False}
def test_토사_단추는_지반_칸만(out):
assert out["soilChange"] == {"ground_type": "soil"}
def test_세션_고름은_바꾼_칸끼리_얹음(out):
assert out["choice"] == {"20": {"ditch_choice": False, "two_stage_slope": True}}
assert out["choiceAfterEmpty"] == out["choice"]
def test_결과_통은_떠남_확인에_안_잡힘(out):
assert out["dirtyBermOnly"] is False
assert out["dirtyWithEdit"] is True