- 고른 적 없으면 설계 지형(라이다가 있으면 라이다) · 사용자가 바꿀 때만 기억 - 하나뿐인 프로젝트는 있는 지형만 · 옛 값 무시 - 바꾸면 노선 초안으로 계산 묶음에 알림 · 설계 지형이 수치지형도면 확정 모델 등고선을 LAS 로 쓰지 않음 - 시험 test_352_3 추가 · 133_1 · 133_2 고쳐 씀 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
55 lines
2.1 KiB
Python
55 lines
2.1 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 "options.draft?.edited(" in handler # 바꾸면 계산 묶음에 알림
|
|
# 설계 지형이 수치지형도면 확정 모델(수치지형도 서피스) 등고선을 「LAS」로 쓰지 않음
|
|
assert 'analysisTerrain(projectId) === "las" && designTerrain === "las"' in main
|