Files
Aislo/resources/tester/test_364_6_std_panel_same_value.py
T
eomsangdonandClaude Opus 5.5 be4383f81f fix(B06 표준 횡단): 364-6 칸 열기만으로 암 표준값이 토사 값으로 바뀌던 것 — 편집 없이 B05 = B06 누가토량
- 까닭: 표준 횡단 칸이 열릴 때 공통 칸을 토사 값으로 펼쳐 세션을 고침(암 측구 상폭 0.69 → 0.9 · 암 횡단경사 3 → 3~5) → B06 다시 셈이 암 측점 절토를 키움 · 성토 그대로
- 고침: 열기 · 저장값 복원 · 초기 값 · 다른 프로젝트 불러오기 = 그룹 값 그대로 · 공통 칸은 고칠 때만 펼침
- 검증_sub7 노선 304: 칸 열기 전후 절토 면적 합 402.9 → 444.4 ㎡(56/67 측점) → 고친 뒤 같음 · 서버 셈 = B05 셈
- 시험 test_364_6_std_panel_same_value.py 6(옛 코드 4 실패) · 관련 25 · typecheck

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TteK8mfYZetk5P3bEZkyVZ
2026-10-17 00:23:06 +09:00

85 lines
2.7 KiB
Python

# -*- coding: utf-8 -*-
"""364-6 — 편집 없이 B06 를 열어도 B05 와 같은 누가토량.
까닭: B06 표준 횡단 칸이 열릴 때 공통 칸을 토사 값으로 펼쳐 암 측구 상폭 0.69 → 0.9 ·
암 횡단경사 3 → 3~5 로 세션을 고쳤음 → 다시 셈이 그 값으로 절토를 키움(성토 그대로).
못박는 것
- 브라우저 다시 셈(칸 없음 = B05) = 서버 저장 면적.
- 칸 열림(B06) 뒤 다시 셈 = B05 값 · 세션 표준 횡단 = 서버가 쓴 값 그대로.
- 저장 표준 횡단이 세션에 먼저 채워진 길도 같음.
Node 헬퍼 `helper_364_6_std_panel.mjs` 가 vite ssr 로 묶은 진짜 모듈(`helper_364_6_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("b364_6")
build = subprocess.run(
[
"node",
str(ROOT / "config" / "node_modules" / "vite" / "bin" / "vite.js"),
"build",
"--configLoader",
"runner",
"--ssr",
"../resources/tester/helper_364_6_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_364_6_entry.js", bundle)
proc = subprocess.run(
["node", str(HERE / "helper_364_6_std_panel.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)
def _close(a: list, b: list) -> bool:
return all(abs((x[k] or 0) - (y[k] or 0)) < 1e-6 for x, y in zip(a, b, strict=True) for k in x)
def test_고정_자료는_암_측구가_토사와_다름(out):
std = out["standard"]
assert std["rock"]["ditch"]["top_width_m"] != std["soil"]["ditch"]["top_width_m"]
def test_B05_다시_셈은_서버_면적(out):
assert _close(out["config"]["b05"], out["server"])
@pytest.mark.parametrize("case", ["config", "stored"])
def test_B06_칸_열어도_B05_값(case, out):
assert _close(out[case]["b06"], out[case]["b05"])
@pytest.mark.parametrize("case", ["config", "stored"])
def test_칸_열기는_표준_횡단을_안_고침(case, out):
assert out[case]["session"] == out["standard"]