Files
Aislo/resources/tester/test_384_3_planted_base.py
T
eomsangdonandClaude Opus 5.5 2db6946365 fix(467 덧 새 측점 계획고): 짝 없는 새 측점(구조물 · 추가 측점 · 새 관)엔 계획선 꼭짓점을 안 세움 — [저장]으로 계획고가 지반고로 바뀌던 흠
- 파이썬 _follow_moved_stations · TS followMovedNodes(짝) — seat 기본 = 빈 목록 · 짝 있는 옮긴 관 · 구조물은 427 그대로
- 검증_sub5(계획고 = 지반고 상태) 소단 22+0 저장 = −17,595.6 → −17,499.3 이던 것 · 435 · 445 m 계획고가 지반고로 바뀜
- 시험 test_427_1(짝 없는 새 측점 = 꼭짓점 없음 · 놓기 전 계획선 높이 · TS 거울 125 · 287 그대로 통과) · test_384_3(심은 측점에 꼭짓점 없음) 고침

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:01:03 +09:00

94 lines
3.6 KiB
Python

"""PLAN 386-3 sub7 — 묶음 입력 = 가게만(보기 측점 심기 · baseMoved 지움).
못박는 것
- 묶음 planline 저장 기준 = 저장 상세 + 지금 입력(관 · 구조물)이 심는 측점(`plantedBase` · 보기와 같은 셈) —
종류 = 정의 전부(꺼진 종류도 심음) · 상세가 없으면 종단도 기준.
- 보기가 종단도에 늦게 심어도(종단도 기준이 바뀌어 restart) 묶음은 안 돎 · 열 때 1 · 같은 입력 0.
- `baseMoved` 없음 · 페이지(design_shared)가 옵션으로 넘김(묶음은 화면 모듈을 안 끌어옴).
짝: `helper_384_3_entry.ts` + `helper_384_3_planted.mjs`(진짜 모듈 · vite ssr) · `helper_365_page_pipeline.cjs` ⑬.
"""
from __future__ import annotations
import json
import shutil
import subprocess
import sys
from pathlib import Path
import pytest
HERE = Path(__file__).resolve().parent
ROOT = HERE.parents[1]
if str(HERE) not in sys.path:
sys.path.insert(0, str(HERE))
from test_365_page_pipeline import r # noqa: E402,F401 — 묶음 시험 한 벌(⑬ 늦게 심은 측점)
@pytest.fixture(scope="module")
def planted(tmp_path_factory) -> dict:
work = tmp_path_factory.mktemp("b386")
build = subprocess.run( # noqa: S603 — 고정 실행 파일
[
"node",
str(ROOT / "config" / "node_modules" / "vite" / "bin" / "vite.js"),
"build",
"--configLoader",
"runner",
"--ssr",
"../resources/tester/helper_384_3_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_384_3_entry.js", bundle)
proc = subprocess.run( # noqa: S603 — 고정 실행 파일
["node", str(HERE / "helper_384_3_planted.mjs"), str(bundle)],
capture_output=True,
text=True,
encoding="utf-8",
timeout=120,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_저장_기준_입력이_심는_측점(planted):
assert [c for _, c in planted["none"]] == [0, 20, 40, 60] # 심을 것 없음 = 저장 상세 측점
assert ["irregular", 33] in planted["pipe"] # 구조물 자리
assert ["irregular", 33] in planted["both"] and ["irregular", 47] in planted[
"both"
] # 꺼진 종류도
assert planted["noDetail"] is True # 상세 없음 = 종단도 기준
# 저장 꼭짓점(양 끝)만 — 짝 없는 새(심은) 측점엔 꼭짓점 안 세움(계획선 그대로 · 467 · 요구 272)
assert planted["pviAt"] == [0, 60]
assert planted["pvi"] == 2
def test_늦게_심어도_안_돎(r):
late = r["late"]
assert late["openRuns"] == 1 # 열 때 1
assert late["lateRuns"] == 0 # 종단도 기준이 바뀌어도(보기가 늦게 심음) 안 돎
assert late["same"] == 0 and late["sameRuns"] == 0 # 같은 입력 0
assert late["planted"] is not None # planline 이 입력(관)으로 기준을 셈
def test_baseMoved_없음_옵션은_페이지가():
pipe = (ROOT / "A00_Common/design/design_pipeline_page.ts").read_text(encoding="utf-8")
shared = (ROOT / "A00_Common/design/design_shared.ts").read_text(encoding="utf-8")
assert "baseMoved" not in pipe
assert "design_pipeline_base" not in pipe # 묶음은 화면 모듈을 안 끌어옴
assert "options.plantedBase?.(savedSource(), at, types)" in pipe
assert "plantedBase, //" in shared