"""PLAN 322-3 고침 — 노선이 바뀌어 관을 좌표로 옮길 때(투영 이월) 끝 = 선 길이. B05 계획선 꼭짓점은 누가거리 0 으로 와서 끝이 0 으로 잡혀 관이 전부 0 m 로 가던 흠. """ from __future__ import annotations import json from B05_Profile.B05_Profile_Engine_Sections import _load_pipe_points LINE = [[0.0, 0.0, 100.0], [300.0, 0.0, 100.0]] def test_projected_pipes_snap_to_whole_metres_not_zero(tmp_path) -> None: folder = tmp_path / "B04_PreProcess" / "drainage" / "edits" folder.mkdir(parents=True) points = [ {"chainage_m": 85.05, "source": "user", "x": 90.05, "y": 0.3}, {"chainage_m": 173.09, "source": "user", "x": 178.4, "y": 0.2}, ] (folder / "pipe_points.json").write_text( json.dumps({"route_signature": "옛노선", "points": points}), encoding="utf-8" ) assert [pipe.chainage_m for pipe in _load_pipe_points(tmp_path, LINE)] == [90.0, 178.0]