Files
Aislo/resources/tester/test_b06_patch_station.py
T
eomsangdonandClaude Opus 5.5 93e86f87c6 fix(b05,b06): 측점 한 벌 — 정수 m · 같은 m 측점 하나 · 목록 전체 다시 맞춤 (272)
- 규칙: 구조물 · 관 기준 측점 = 정수 m 사사오입(일반 측점 1 m 붙기 뺌) · 측점 심는 자리 TS 짝(plantedChainages ↔ resolve_extra_stations) · 같은 m 면 구조물 측점 하나(격자 자리 grid) · 떠나면 일반 측점(oneStationList ↔ _merge_irregular_into_longitudinal)
- 서버: B05 [저장] · B06 저장 · [측점 만들기]가 목록 전체 다시 맞춤(빈 목록도 · 옛 글 · 횡단 파일 글) · 계획선 측점 줄 다시 셈 · 정본에 없는 횡단 행은 0.5 m 안 새 측점으로 옮기고 나머지 지움 · 옛 소수 측점 꼭짓점 · 편집은 정수 자리로 · 맞춤 실패는 저장을 안 막음
- 화면: 종단 그래프 · 3D · 표 · ▲▼ 한 목록(초안 반영) · C군 구간형 · 독립 기슭막이 시작 · 끝 측점 · B06 카드는 초안에 없는 옛 구조물 측점 숨김 · 고름은 같은 m 구조물 측점 먼저 · 폼 거리 칸 정수 표기 · C군 계산 구간 · 포장 나눔 경계 정수
- 옛 자료: [정수 맞춤] 단추 없앰 · 종단 보기 열 때 한 번 자동 정수 · 알림 한 줄 · [저장]하면 남음
- 시험: test_272_1 · test_272_2 새로 · 234_1 · 238_1 · b05_extra_stations_supplier · b06_patch_station · b05_station_roundtrip · b05_b06_save_roundtrip 맞춤

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LLCk2y5xE8YGVgjbTntWsY
2026-10-11 19:53:24 +09:00

42 lines
1.7 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
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)
asyncio.run(_stand_patch_stations(PROJECT))
return called
def test_행_없는_측점_수정이면_측점을_세움(monkeypatch):
assert _calls(monkeypatch, [120.0, 263.47], [120.0, 140.0]) == [PROJECT]
def test_모든_수정에_행이_있어도_맞춤은_부름(monkeypatch):
# 272 — 옮긴 관의 옛 측점 · 떠난 격자 자리 글을 지우려고 늘 부름(맞출 것이 없으면
# `ensure_structure_stations` 가 0 으로 그냥 돌아옴)
assert _calls(monkeypatch, [120.0, 140.004], [120.0, 140.0]) == [PROJECT]
assert _calls(monkeypatch, [], [120.0]) == [PROJECT]
def test_소수_측점_수정도_맞춤을_부름(monkeypatch):
assert _calls(monkeypatch, [119.8], [120.0]) == [PROJECT]
assert _calls(monkeypatch, [119.8], [119.8, 120.0]) == [PROJECT]