fix(346-3): B06 [저장] · [확정] 측점 맞춤 뒤 옛 횡단 파일 정리(GET 대신 쓰는 쪽)
- _prune_cross_files = 종단 측점에 없는 cross_*.json 지움 · 측점을 못 읽으면 안 지움 - 시험 test_346_3_route_save 에 정리 · 차례 한 벌 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
This commit is contained in:
@@ -539,3 +539,23 @@ def test_계획고_옮김은_앞_그대로_뒤_밂(tmp_path, monkeypatch):
|
||||
assert edits["40.000"] == 0.7 # 바뀐 구간 앞 — 그대로
|
||||
assert "200.000" not in edits # 바뀐 구간 안 — 새 지반
|
||||
assert edits[f"{380.0 + delta:.3f}"] == 0.3 # 뒤 — 길이 차만큼 밂
|
||||
|
||||
|
||||
def test_저장_확정이_옛_횡단_파일을_지움(tmp_path):
|
||||
from B05_Profile.B05_Profile_Engine_Sections import cross_filename
|
||||
|
||||
long_path = tmp_path / "B06_Section" / "longitudinal" / "longitudinal.json"
|
||||
cross_dir = tmp_path / "B06_Section" / "cross_sections"
|
||||
long_path.parent.mkdir(parents=True)
|
||||
cross_dir.mkdir(parents=True)
|
||||
long_path.write_text(json.dumps({"stations": [{"chainage_m": 0.0}, {"chainage_m": 20.0}]}))
|
||||
for at in (0.0, 20.0, 37.0):
|
||||
(cross_dir / cross_filename(at)).write_text("{}")
|
||||
b06_confirm._prune_cross_files(tmp_path, "B06_Section/longitudinal/longitudinal.json")
|
||||
assert sorted(p.name for p in cross_dir.glob("cross_*.json")) == sorted(
|
||||
cross_filename(at) for at in (0.0, 20.0)
|
||||
)
|
||||
source = (ROOT / "B06_Section" / "B06_Section_Router_Confirm.py").read_text("utf-8")
|
||||
for name in ("async def save_sections(", "async def confirm_sections("):
|
||||
body = source[source.index(name) :]
|
||||
assert body.index("_stand_patch_stations(") < body.index("_prune_cross_files,")
|
||||
|
||||
Reference in New Issue
Block a user