Files
Aislo/resources/tester/test_384_3_planted_base.py
T
eomsangdonandClaude Opus 5.5 eedafe8db9 fix(451 B06 세션 캐시 판): 세션 상세 뒤에서 서버 판 확인 · 다르면 서버 값 위 내 칸만 · 숨은 종단 보기 관 id 장부 · 384_3 단언 427 의도
- 433-16: 새로고침 · 새 탭 = 세션 상세로 먼저 섬 · 뒤에서 상세 GET(ETag 304) · 판이 다르면 서버 값 위에 이 탭에서 고친 사용자 칸만 · [저장] patch 바탕도 새 판 · 노선 초안 hold 는 버릴 때 새 판
- 440-3: 숨은 종단 보기도 관 세션 id 장부 돌림(평면 마커 누름 = 초안 자리) · 그리기는 보일 때
- 384_3: pvi 단언 = 저장 꼭짓점 + 심은 측점마다 세운 꼭짓점(427)
- 384_7: 세션 쓰기 = 받을 때 · 판 확인 새 판 둘

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 21:37:07 +09:00

95 lines
3.7 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 # 상세 없음 = 종단도 기준
# 저장 꼭짓점(양 끝) + 심은 측점마다 세운 꼭짓점(427 · seatBornNodes)
born = [c for k, c in planted["both"] if k == "irregular" and 0 < c < 60]
assert planted["pviAt"] == sorted([0, 60, *born])
assert planted["pvi"] == 2 + len(born)
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