- 고정 한 벌 — 시점 · 종점(기본 고정) · 교각점을 한 칸 줄로 봄 · 저장 · 읽기는 _RouteEdit_Lock.ts(readRouteLocks = 초기노선 계산에 넘길 한 곳) - 곧은 선은 양 끝 · 호는 교각점과 앞뒤 점이 모두 고정일 때 고정 색(--map-route-locked · 밝음 #db2777 · 어두움 #f472b6) · 고정 점도 같은 색 - 시점 · 종점을 누르면 고정 단추만 뜸 · 풀면 끌어 옮김 · 고정이면 끌기 · 지우기 막힘 - 되돌리기 · [취소] · 다시 열기 · [확인] 뒤에도 고정 유지(pref 통 · 좌표로 되짚음) · [확인] 몸통은 그대로 - 시험 test_b05_routeedit_lock 5건 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BU9gbNE3aWFUvE61pS2WGt
57 lines
2.0 KiB
Python
57 lines
2.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""계획노선 편집 창 — **고정 한 벌**(계획서 22-4 · 22-5) 회귀검증.
|
|
|
|
시점 · 종점은 기본 고정 · 교각점 고정은 좌표로 다시 짚음 · 곧은 선은 양 끝 · 호는 교각점과
|
|
앞뒤 점이 모두 고정일 때 고정. 자리는 화면 상태 보관소 pref 통의 프로젝트 칸.
|
|
|
|
Node 헬퍼(`helper_b05_routeedit_lock.cjs`)가 TS 를 트랜스파일해 돌리고, 여기서 값을 판정한다.
|
|
"""
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
|
|
import pytest
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def results():
|
|
proc = subprocess.run(
|
|
["node", os.path.join(HERE, "helper_b05_routeedit_lock.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=60,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
return json.loads(proc.stdout)
|
|
|
|
|
|
def test_저장된_것이_없으면_시점_종점만_고정(results):
|
|
assert results["fresh"] == {"start": True, "end": True, "apex": []}
|
|
assert results["freshColumn"] == [True, False, False, True]
|
|
|
|
|
|
def test_저장소_왕복은_프로젝트마다(results):
|
|
assert results["readBack"] == {"start": False, "end": True, "apex": [[100, 0], [150, 80]]}
|
|
assert results["otherProject"] == {"start": True, "end": True, "apex": []}
|
|
assert results["storedKeys"] == ["aislo:pref:routeedit-locks:p-1"]
|
|
|
|
|
|
def test_교각점은_좌표로_다시_짚음(results):
|
|
# 0.05m 안은 같은 점 · 1m 옮긴 점은 풀림 · 시점 · 종점은 자리와 무관하게 역할로.
|
|
assert results["nudgedColumn"] == [False, True, False, True]
|
|
|
|
|
|
def test_선과_호_고정_판정(results):
|
|
assert results["straight"] == [False, True, True]
|
|
assert results["arc"] == [False, True]
|
|
assert results["arcAll"] == [True, True]
|
|
|
|
|
|
def test_빈_노선은_안_지우고_깨진_값은_기본값(results):
|
|
assert results["keptAfterEmpty"] == results["readBack"]
|
|
assert results["broken"] == {"start": False, "end": True, "apex": [[2, 3]]}
|