- 하한 검사 = 모든 평면 조작이 applyEdit 에서 지난 걸음과 견줌 · 새로 깨면 그 걸음으로 되돌림 · 까닭 상태줄(끼우기 · 지우기 · 놓기 · 방향키 · 곡선 칸) · 손잡이 끌기도 걸음마다 검사 - 곡선 삭제 = 내각 155° 미만이면 막지 않고 경고(상태줄 · 알림) - 끌기 · 손잡이 놓을 때 스냅 켬이면 「함께 밀린 교점 · 못 맞춘 곡선」 보고 - 스냅 끔 · 간격 바꿈 = 계산 줄에 초안 바로(tellDraft) - R · 길이 고정 · 넣은 R = 곡선표 edits 칸(짝 B05_Profile_Route_NodeEdits.py ↔ flattenServerPlan) · 다시 열면 넣은 값으로 - 상태줄 = 겹친 노드(0.5 m 안) · 못 그린 곡선 표시 - 시험 test_430_route_edit_rules · 배선 바뀐 시험 둘(352-3 · 390-4) · 398-2 도우미 알림 가짜 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TteK8mfYZetk5P3bEZkyVZ
56 lines
2.2 KiB
Python
56 lines
2.2 KiB
Python
"""352-3 분석 지형 기본값 — 고른 적 없으면 데이터대로 · 열 때 안 씀 · 사용자가 바꿀 때만 기억 · 바꾸면 묶음에 알림.
|
|
|
|
./venv/Scripts/python.exe -m pytest resources/tester/test_352_3_analysis_terrain_default.py -q
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
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() -> dict:
|
|
run = subprocess.run( # noqa: S603 — 고정 실행 파일
|
|
["node", str(HERE / "helper_352_3_terrain.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
)
|
|
assert run.returncode == 0, run.stderr
|
|
return json.loads(run.stdout)
|
|
|
|
|
|
def test_고른_적_없으면_데이터대로_열_때_안_씀(out) -> None:
|
|
assert out["unknown"] == "las"
|
|
assert out["bothNoPick"] == "las" # 라이다가 있는 프로젝트 = 라이다
|
|
assert out["writesAfterOpen"] == 0 # 열 때 pref 에 쓰지 않음
|
|
assert out["sheetDesignNoPick"] == "sheet" # 설계 지형대로 — 고르기 글 = 실제 쓰는 지형
|
|
|
|
|
|
def test_사용자가_바꿀_때만_기억(out) -> None:
|
|
assert out["afterPick"] == "sheet" and out["writesAfterPick"] == 1
|
|
assert out["nextAccess"] == "sheet" # 다음 접근에도
|
|
|
|
|
|
def test_하나뿐이면_있는_것만(out) -> None:
|
|
assert out["sheetOnlyStale"] == "sheet"
|
|
assert out["lasOnlyStale"] == "las"
|
|
|
|
|
|
def test_편집기_배선() -> None:
|
|
main = (ROOT / "B05_Profile/B05_Profile_UI_RouteEdit.ts").read_text(encoding="utf-8")
|
|
assert main.count("setAnalysisTerrain(") == 1 # 바꿀 때 한 곳뿐 — 열 때 쓰기 없음
|
|
handler = main.split('terrainSelect.addEventListener("change"', 1)[1][:900]
|
|
assert "setAnalysisTerrain(projectId" in handler
|
|
assert "tellDraft()" in handler # 바꾸면 계산 묶음에 알림(430 — 스냅과 한 곳)
|
|
assert "options.draft?.edited(" in main.split("function tellDraft()", 1)[1][:400]
|
|
# 설계 지형이 수치지형도면 확정 모델(수치지형도 서피스) 등고선을 「LAS」로 쓰지 않음
|
|
assert 'analysisTerrain(projectId) === "las" && designTerrain === "las"' in main
|