Files
Aislo/resources/tester/test_342_1_station_line.py
T
eomsangdonandClaude Opus 5.5 6a3f9647f3 refactor(387-4): 횡단 다시 셈 창구 하나 · 면적 얹기 한 곳 — 화면은 묶음에 부탁
- 다시 셈(refreshCrossDesigns) 부르는 곳 = 묶음 cross 단계 하나(design_shared savedCross)
- 종단 미리 셈 · B06 설계 맞춤 · 3D 업데이트 = pipelineCross · reconcilePagePipeline(▲ 한 번 = cross 한 번)
- 입력 칸 밖 세션 고침(노견 · 소단 · 단면 유형 · 조정창)은 forceCross 로 같은 입력이어도 한 번 더
- 카드 그리기 · 횡단 보기 면적 쓰기 지움 · 다시 셈 창구가 면적을 늘 얹음(바뀐 측점만 알림)
- 저장 안 한 조정창 값을 상세 가게가 읽을 때 얹음(새 Section_Adjusts · B05 만 열어도 같은 면적)
- 새 test_384_4_cross_window · 옛 약속 시험 넷 새 약속으로

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014utrjfoW831Vc5wJUd13kL
2026-10-17 18:19:21 +09:00

128 lines
4.4 KiB
Python

# -*- coding: utf-8 -*-
"""342-1 · 346-2 — 계획선 한 벌 · 낡음 머묾 · 국부 연산 · 흙 배분 열쇠 · [전체 측점 반영] · 카드.
못박는 것
- 머묾 재현: 서버 측점 85.054(0.001 m) · 관 지점 85.05(0.01 m) · 종단곡선 안 — 저장분 선으로
다시 세면 화면 선 기준 낡음이 남음(옛 길) · 화면 선을 받으면 낡음 0 · B05 · B06 판정 같음.
- 국부 연산: 같은 입력 다시 셈 0 측점 · 계획고 ▲ 한 번 = 곡선 둘레 몇 측점 · 결과 = 통째 셈.
- 다시 셈 뒤에도 남은 낡음 = 기다림 끝(false) · 콘솔 경고 한 줄 · 다시 그림(곡선은 그림).
- 흙 배분: 실패한 열쇠 다시 보냄 · 받아 둔 열쇠는 다시 안 물음.
- [전체 측점 반영] = 다시 셈 한 번 · 측점 선택을 세션에 안 박음.
- 횡단 카드: 보이는 카드만 바로 · 나머지는 쉬는 틈에.
Node 헬퍼 `helper_342_1_station_line.mjs` 가 vite ssr 로 묶은 진짜 모듈(`helper_342_1_entry.ts`)을
부름.
"""
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(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from config.config_system import STANDARD_CROSS_SECTION # noqa: E402
FIXTURE = HERE / "fixtures" / "b05_192_1_moved_pipe_longitudinal.json"
@pytest.fixture(scope="module")
def out(tmp_path_factory):
work = tmp_path_factory.mktemp("b342")
build = subprocess.run(
[
"node",
str(ROOT / "config" / "node_modules" / "vite" / "bin" / "vite.js"),
"build",
"--configLoader",
"runner",
"--ssr",
"../resources/tester/helper_342_1_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_342_1_entry.js", bundle)
policy = json.loads(FIXTURE.read_text(encoding="utf-8"))["profile_alignment"]["policy"]
source = work / "input.json"
source.write_text(
json.dumps({"standard": STANDARD_CROSS_SECTION, "policy": policy}, default=str),
encoding="utf-8",
)
proc = subprocess.run(
["node", str(HERE / "helper_342_1_station_line.mjs"), str(bundle), str(source)],
cwd=ROOT,
capture_output=True,
text=True,
encoding="utf-8",
timeout=120,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_화면_선은_관_지점으로_갈음(out):
assert 85.05 in out["screenStations"] and 85.054 not in out["screenStations"]
def test_머묾_재현_옛_길은_낡음이_남음(out):
assert out["staleBefore"] == [85.054]
assert out["staleOldPath"] == [85.054]
assert out["staleAgainstScreenBefore"] is True
def test_화면_선을_받으면_낡음_0_두_판정_같음(out):
assert out["staleNewPath"] == []
assert out["staleAgainstScreenAfter"] is False
assert out["staleB06View"] == []
def test_국부_연산_바뀐_측점만(out):
assert out["recomputedSame"] == 0
assert 0 < out["recomputedEdit"] < out["total"]
assert out["sameAsWhole"] is True
def test_남은_낡음은_곡선을_그리고_경고(out):
# 387-4 — 미리 셈은 다시 셈을 안 함(묶음 cross 한 곳) · 기다릴 묶음 차례가 없으면 곧바로 곡선 + 경고
assert out["settleFirst"] is False
assert out["settleSameKey"] is True
assert out["settleAfter"] is False
assert out["settleWarns"] == 1
assert out["settleRedraws"] == 0
assert out["settleClear"] is False
def test_흙_배분_실패_열쇠_다시_보냄_받은_열쇠는_안_물음(out):
assert out["haulAfterFail"] == 1
assert out["haulRetry"] == 2
assert out["haulB"] == 3
assert out["haulKept"] == 3
assert out["haulKeptPlan"] == 2
def test_전체_측점_반영은_한_번_선택_안_박음(out):
assert out["applyAllCalls"] == [] # 387-4 — 화면이 직접 안 셈 · 묶음 cross 가 셈
assert out["applyAllChoiceKeys"] == 0
def test_횡단_카드_보이는_것_먼저(out):
assert out["cardsNow"] == [0, 20, 40]
assert out["cardsRedraws"] == 1
assert sorted(out["cardsAll"]) == [0, 20, 40, 60, 80]