Files
Aislo/resources/tester/test_346_2_draft_cross_pills.py
T
eomsangdonandClaude Opus 5.5 ec0bb044c2 feat(365-4): 한 바퀴 정리 — 저장 노선 계획고 = 횡단 한 벌 · B06 다시 그림 한 번
- 저장 노선 cross = 다시 셈 창구 한 벌(refreshCrossDesigns · 카드 · 유토곡선 · [저장] 패치가 보는 상세 설계) — 묶음 cross 가 부르고 그 설계를 냄(detailCross) · 종단도 계획고 편집 뒤 따로 예약 안 함(pipelineOwnsCross)
- B06 다시 그림 — 묶음 차례는 cross 뒤에만 · 겹친 신호(갈아끼움 · 묶음 · 초안)는 refreshDetailForStructures 한 번(최신 차례만)
- 중심점 좌우 = 노선 차례가 cross 전에 밀림 → cross 한 번(계획고 맞춤 차례 · 시험으로 못박음)
- stationDiff → logic/design_pipeline_stations(700줄)
- 시험 test_365(저장 ▲▼ 다시 셈 1 · 상세 설계 그대로 · 중심점 좌우 cross 1) · 346-2 pills · 230-2 고침

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

82 lines
2.7 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
"""346-2 덧 3 — 노선 초안 동안 횡단 카드 · 종단 구조물 알약.
못박는 것
- 횡단 카드 = 노선 초안 동안 묶음 새 노선 상세(`pipelineDetail`) · profile · cross 단계 뒤 다시 그림 ·
숨은 동안은 안 그림(상세는 새것) · 초안을 버리면 저장 노선 카드 · 묶음이 횡단 보기보다 늦게 서도 붙음 ·
끊으면 안 그림.
- 종단 알약 = follow 뒤 자리 — 구조물은 id 짝 · 관은 세션 id ≠ 서버 id 라 누가거리 차례 짝 ·
구간형 띠도 옮김 · 짝 없는 것은 그대로 · 관 수가 안 맞으면 관은 안 옮김 · 초안을 버리면 저장 자리.
Node 헬퍼 `helper_346_2_draft_cross_pills.cjs` 가 진짜 TS 를 트랜스파일해 부름.
"""
import json
import subprocess
from pathlib import Path
import pytest
HERE = Path(__file__).resolve().parent
ROOT = HERE.parents[1]
@pytest.fixture(scope="module")
def out():
proc = subprocess.run(
["node", str(HERE / "helper_346_2_draft_cross_pills.cjs")],
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):
cards = out["cards"]
assert cards["before"] == "saved"
assert cards["afterDraft"] == ["draft-cross-1"] # profile 차례 중간 상세는 안 그림(365-4)
assert cards["draftNow"] == "draft-cross-1"
def test_숨은_동안은_안_그림(out):
cards = out["cards"]
assert cards["whileHidden"] == ["draft-cross-1"]
assert cards["hiddenNow"] == "draft-cross-2"
def test_초안_버리면_저장_노선_카드(out):
cards = out["cards"]
assert cards["discarded"][-1] == "saved" and cards["savedNow"] == "saved"
assert cards["afterStop"] == 2 # 끊은 뒤엔 안 그림
def test_알약은_따라간_누가거리(out):
draft = out["pills"]["draft"]
# x = 누가거리 × 10 px — 관 30 → 33 · 90 → 96(차례 짝) · 구조물 id 짝 · 짝 없는 st-9 그대로
assert draft["left"] == {
"pipe-s1": 330,
"st-1": 550,
"st-2": 720,
"pipe-s2": 960,
"st-9": 1200,
}
assert draft["band"] == [620, 200] # 구간형 띠 62 ~ 82 m
def test_초안_버리면_저장_자리_관_수_다르면_관은_그대로(out):
pills = out["pills"]
assert pills["saved"]["left"] == {
"pipe-s1": 300,
"st-1": 500,
"st-2": 700,
"pipe-s2": 900,
"st-9": 1200,
}
assert pills["saved"]["band"] == [600, 200]
assert pills["short"] == [30, 55, 72, 90, 120]
assert pills["untouched"] == 50 # 원본 목록은 안 고침