Files
Aislo/resources/tester/test_756_1_contour_band.py
T
eomsangdonandClaude Sonnet 5.5 1288e21e55 feat(756-1): 추천 선 진하게 · 스냅 한 아이콘 · 추천노선 여럿 고르기 · 켠 동안 등고선 띠 넓힘
- 예정노선 수정 켬에도 추천 선 불투명 그대로(Render)
- 스냅 + 스냅 간격 = 고르기 메뉴 하나(측점 No. · 10 m · 끔) · 도구줄 표 snap-step 줄 걷음
- 추천노선 = 여럿 고르기(공용 부품 multi · 줄 색 점 PickMenuItem.color · 끔 줄 없음) · 선 색 --draw-map-rec-1~4 · 예정노선 가이드 선은 켬끔 한 줄
- 켠 동안 등고선 띠 = LAS 는 자르지 않음 · 도엽은 계획선 + 예정노선으로 넓힘(캔버스 · GL · 도엽 다시 받기)
- 시험 624_2 · 634_2 · 626_1 · 636_2 · 390_4 · b05_routeedit_initial 을 새 꼴로 고침 · 새 시험 756_1

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 22:58:28 +09:00

64 lines
2.1 KiB
Python

"""756-1 (요구 589-10) — 예정노선 수정 켬 때 등고선 띠: LAS = 자르지 않음 · 도엽 = 계획선 + 예정노선으로 넓힘.
./venv/Scripts/python.exe -m pytest resources/tester/test_756_1_contour_band.py -q
"""
import json
import subprocess
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[2]
B05 = ROOT / "B05_Profile"
INPUT = B05 / "B05_Profile_UI_RouteEdit_Input.ts"
TS = ROOT / "config" / "node_modules" / "typescript"
NODE = """
const fs = require("fs");
const ts = require(process.argv[1]);
const js = ts.transpileModule(fs.readFileSync(process.argv[2], "utf8"), {
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
}).outputText;
const box = { exports: {} };
new Function("exports", "module", "require", js)(box.exports, box, () => new Proxy({}, { get: () => () => {} }));
const { sceneContourBand } = box.exports;
const toScreen = ([x, y]) => [x, -y]; // 1 px = 1 m
const plan = [[0, 0], [100, 0]];
const expected = [[0, 0], [100, 0], [100, 1000]];
const run = (source, dim) =>
sceneContourBand({ hasMeta: true, contours: { source }, overAll: { dim: () => dim }, expected }, plan, toScreen, 300);
console.log(JSON.stringify({
offSheet: run("sheet", 1),
onSheet: run("sheet", 0.35),
onLas: run("las", 0.35),
offLas: run("las", 1),
}));
"""
@pytest.fixture(scope="module")
def bands() -> dict:
run = subprocess.run( # noqa: S603 — 고정 실행 파일
["node", "-e", NODE, str(TS), str(INPUT)],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert run.returncode == 0, run.stderr
return json.loads(run.stdout)
def test_끈_동안은_계획선_둘레_띠_그대로(bands) -> None:
assert bands["offSheet"]["height"] == 600 # 계획선 y 0 ± 300 m
assert bands["offLas"] is not None
def test_켠_동안_도엽은_예정노선까지_넓힘(bands) -> None:
assert bands["onSheet"]["height"] == 1600 # 예정노선 y 0~1000 ± 300 m
def test_켠_동안_LAS는_자르지_않음(bands) -> None:
assert bands["onLas"] is None