fix(765-3): 두 벌 = 같은 평면 노선 — 예상노선을 설계 지형으로 먼저 잘라 적고 다른 지형 벌도 그 노선으로 지음
- 검증_sub5 실측: 수치지형도 벌이 수치지형도로 자른 긴 노선(2110 m)으로 지어져 공유 예상노선(라이다로 자름 · 1377 m)과 어긋남 → 그 벌 [초기화] 뒤 초기 폴리라인이 예상노선(라이다)으로 다시 지어져 노선 1359.6 m · 종횡단 2110 m 로 갈림 - 예상노선(공유 · 추천 열쇠)은 하나 · 설계 지형으로 자름 → 옛 지형 칩처럼 평면 노선 같고 지형만 다름 - 다른 지형 벌 끝에 예상노선 지우던 길 걷음(먼저 적으니 필요 없음) - 시험 test_765_design_sets 체인 차례에 예상노선 먼저 적기 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -428,9 +428,11 @@ def _chain_world(monkeypatch, tmp_path: Path, *, other, built_other=True):
|
||||
|
||||
async def auto(pid, model_id=None, inner=False):
|
||||
log.append(("auto", model_id, inner))
|
||||
expected.parent.mkdir(parents=True, exist_ok=True)
|
||||
expected.write_text(str(model_id), encoding="utf-8") # 체인이 처음 쓰는 예상노선
|
||||
return {"route_id": 1} if (built_other or len(log) > 2) else None
|
||||
if not expected.is_file(): # 체인 2.5 — 없을 때만 그 지형으로 자른 예상노선
|
||||
expected.parent.mkdir(parents=True, exist_ok=True)
|
||||
expected.write_text(str(model_id), encoding="utf-8")
|
||||
first = sum(1 for item in log if item[0] == "auto") == 1
|
||||
return {"route_id": 1} if (built_other or not first) else None
|
||||
|
||||
async def switch(_c, _pid, terrain):
|
||||
log.append(("switch", terrain))
|
||||
@@ -459,7 +461,14 @@ def _chain_world(monkeypatch, tmp_path: Path, *, other, built_other=True):
|
||||
monkeypatch.setattr(sets, "park_active_set", park)
|
||||
monkeypatch.setattr(sets, "clear_active_set", clear)
|
||||
monkeypatch.setattr(sets, "set_fingerprint", fingerprint)
|
||||
|
||||
async def seed(_pid, _root, surface):
|
||||
log.append(("seed", surface["source_filter"]))
|
||||
expected.parent.mkdir(parents=True, exist_ok=True)
|
||||
expected.write_text("design", encoding="utf-8")
|
||||
|
||||
monkeypatch.setattr(chain, "run_auto_design_chain", auto)
|
||||
monkeypatch.setattr(chain, "_seed_expected_route", seed)
|
||||
monkeypatch.setattr(router, "schedule_precompute", lambda pid: log.append("precompute"))
|
||||
return chain, log, expected
|
||||
|
||||
@@ -474,6 +483,7 @@ def test_전처리_체인_다른_지형_먼저_떠_두고_설계_지형(monkeypa
|
||||
summary = asyncio.run(chain.run_preprocess_chain(PID, 5)) # type: ignore[arg-type]
|
||||
assert summary == {"route_id": 1}
|
||||
assert log == [
|
||||
("seed", "classification"), # 예상노선 = 설계 지형으로 먼저
|
||||
("switch", "sheet"),
|
||||
("auto", 6, True),
|
||||
("park", "sheet"),
|
||||
@@ -481,7 +491,7 @@ def test_전처리_체인_다른_지형_먼저_떠_두고_설계_지형(monkeypa
|
||||
("auto", 5, True),
|
||||
"precompute",
|
||||
]
|
||||
assert expected.read_text(encoding="utf-8") == "5" # 예상노선 = 설계 지형 벌이 씀
|
||||
assert expected.read_text(encoding="utf-8") == "design" # 두 벌 같은 평면 노선
|
||||
assert not (tmp_path / SETS_DIR / "las").exists()
|
||||
assert not (tmp_path / "initial_design.lock").exists()
|
||||
|
||||
@@ -499,6 +509,7 @@ def test_전처리_체인_다른_벌_실패해도_설계_지형(monkeypatch, tmp
|
||||
summary = asyncio.run(chain.run_preprocess_chain(PID, 5)) # type: ignore[arg-type]
|
||||
assert summary == {"route_id": 1}
|
||||
assert log == [
|
||||
("seed", "classification"),
|
||||
("switch", "sheet"),
|
||||
("auto", 6, True),
|
||||
"clear",
|
||||
|
||||
Reference in New Issue
Block a user