Files
Aislo/resources/tester/test_346_2_draft_cross_pills.py
T
eomsangdonandClaude Opus 5.5 835d8ce828 feat(종단알약): 346-2 덧 3 노선 초안 동안 구조물 · 관 알약 = 묶음 follow 뒤 자리
- 새 logic/B05_Profile_Structure_Follow followedMarks: 묶음 입력(follow 뒤) 관 · 구조물의 새 누가거리를 알약 목록에 얹음 · 구조물 id 짝 · 구간형 시작 · 끝도
- 관 알약 id(세션 id) ≠ 묶음 관 id(서버 고정 id) — 누가거리 차례 짝 · 관 수가 안 맞으면 관은 안 옮김
- Structures_Marks: 노선 초안이 있으면(지금 프로젝트 묶음) 따라간 목록으로 알약 · 띠 · 툴팁 · 초안 버리면 저장 자리
- 시험 test_346_2_draft_cross_pills 5(횡단 카드 = 새 노선 상세 · 숨은 동안 안 그림 · 초안 버림 = 저장 노선 · 알약 자리)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
2026-10-16 13:07:30 +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-profile-1", "draft-cross-1"]
assert cards["draftNow"] == "draft-cross-1"
def test_숨은_동안은_안_그림(out):
cards = out["cards"]
assert cards["whileHidden"] == ["draft-profile-1", "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"] == 3 # 끊은 뒤엔 안 그림
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 # 원본 목록은 안 고침