"""368-4 원지반 점 작은 창 = 지금 계획선 — 아무 누가거리 측점 하나(`probeStation`)가 [측점 추가] 뒤 묶음 측점(`buildStations` + 추가 측점)과 같은 자리 · 틀 · 방위 · 반경 · 확폭 · 열쇠(곡선표 있음 · 없음 · 직선 · 곡선 안). TS 쪽 = `helper_368_4_probe_station.cjs`(Node). 노선 · 관 · 구조물은 344-3 거울 시험 것을 그대로 씀. """ from __future__ import annotations import json import subprocess import tempfile from pathlib import Path import pytest import test_344_3_pipeline_stations_mirror as base HERE = Path(__file__).resolve().parent pytestmark = base.pytestmark @pytest.fixture(scope="module") def out() -> list[dict]: job = { "line": base.LINE, "curves": base.CURVES, "pipes": base.PIPES, "structures": base.STRUCTURES, "types": base._types(), "at": [77.0, 205.0, 213.0], # 직선 · 곡선 안 · 곡선 끝 테이퍼 } with tempfile.TemporaryDirectory() as folder: path = Path(folder) / "job.json" path.write_text(json.dumps(job), encoding="utf-8") proc = subprocess.run( # noqa: S603 — 고정 실행 파일 ["node", str(HERE / "helper_368_4_probe_station.cjs"), str(path)], capture_output=True, text=True, encoding="utf-8", timeout=60, ) assert proc.returncode == 0, proc.stderr return json.loads(proc.stdout) def test_작은_창_측점_묶음_추가_측점과_같음(out) -> None: assert len(out) == 6 for case in out: assert case["after"] is not None, case assert case["mine"] == case["after"], case # 곡선 안 측점은 반경 · 확폭이 실제로 섬(빈 값만 대조하지 않게) assert any(case["mine"]["planRadiusM"] for case in out) assert any(case["mine"]["curveWideningM"] > 0 for case in out)