"""횡단 저장 — 행 없는 측점의 수정을 버리지 않고 그 측점부터 세우는지(PLAN 19장). 옮긴 관 · 구조물 측점은 B05 확정 전이면 DB 행이 없다. 저장 · 확정이 그 자리 수정을 받으면 `ensure_structure_stations`([측점 만들기]와 같은 길)를 불러 측점을 세운 뒤 행을 만든다. DB · 파일 전체 왕복은 test_b05_b06_save_roundtrip [B06] 이 봄 — 여기서는 부르는 조건만. """ import asyncio import B06_Section.B06_Section_Router_Stations as stations from B06_Section.B06_Section_Router_Confirm import _stand_patch_stations from B06_Section.B06_Section_Schema import SectionConfirmRequest PROJECT = "936be972-11bc-46c2-8bf3-b15d8de7df0d" def _calls(monkeypatch, patches: list[float], known: list[float]) -> list[str]: called: list[str] = [] async def fake(project_id): called.append(str(project_id)) return 1 monkeypatch.setattr(stations, "ensure_structure_stations", fake) request = SectionConfirmRequest(cross_patches=[{"chainage_m": c} for c in patches]) asyncio.run(_stand_patch_stations(PROJECT, request, known)) return called def test_행_없는_측점_수정이면_측점을_세움(monkeypatch): assert _calls(monkeypatch, [120.0, 263.47], [120.0, 140.0]) == [PROJECT] def test_모든_수정에_행이_있으면_안_부름(monkeypatch): assert _calls(monkeypatch, [120.0, 140.004], [120.0, 140.0]) == [] assert _calls(monkeypatch, [], [120.0]) == []