Files
Aislo/resources/tester/test_b06_patch_station.py
T
eomsangdonandClaude Opus 5.5 548daa6f4f fix(B06): 옮긴 관 측점의 횡단 수정을 저장 때 버리지 않음 — 행 없으면 측점부터 세움
- 원인: B06 [저장]은 관 측점 비정규 측점을 종단에 싣지 않아(확정은 상단측만) 옮긴 관 자리에 DB 행이 없고, merge_cross_section_designs 가 행 없는 수정을 버림
- 고침(서버 한 곳): 저장 · 확정이 행 없는 측점의 수정을 받으면 ensure_structure_stations — [측점 만들기]와 같은 조건(샘플링 기록)으로 구조물 측점을 세움 → 기존 _rowless_station_chainages 가 기본 설계 행을 만들고 수정이 그 위에 얹힘
- 판정: 화면이 행을 만들려면 지표 샘플링 · 횡단 파일이 필요해 서버만 할 수 있음 — 서버 한 곳으로 충분
- B06_Section_Router_Stations: 측점 다시 뜨기를 _regenerate_structure_stations 로 떼어 단추 · 저장이 같이 씀
- 시험: test_b06_patch_station(부르는 조건) · sub8 왕복 시험 [B06] 통과(프로젝트 사본 · DB 읽기만)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RrQ65VtGZbae2VKgYVMhmc
2026-09-29 10:15:27 +09:00

37 lines
1.5 KiB
Python

"""횡단 저장 — 행 없는 측점의 수정을 버리지 않고 그 측점부터 세우는지(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]) == []