- B05 · B06 [추가] = 그 측점 횡단(카드 · 측점선) 바로 + 세부유역 뒤에서 다시 나눔(세션 초안 · 저장 안 함 · 최신 응답만 · 지도 칸 표시만) — 있던 길 그대로 - 까닭 1: B06 [추가]는 높이 기다림을 판에 안 알려 새 세월교 · 물넘이 월류 높이(126-1)가 빈칸 — 기다림 표를 프로젝트마다 한 벌(fordWaitsOf)로 판 · B06 이 같이 씀 · 채운 높이를 B06 목록 · 폼이 받음(adoptFordHeights) - 까닭 2: B06 알림 글이 「세부 배수유역은 [저장]·[확정] 뒤 계산」 — 실제는 뒤에서 바로 다시 나눔 · 넣기 · 빼기 · 옮기기 글 고침 - 다시 나눔 실패 = 지도 칸 문구 + 토스트 한 줄(analyzeFailed) - 시험: test_298_add_reanalyze 새로 · test_126 · test_291_1 · helper_165 · helper_231_1 맞춤 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
69 lines
2.6 KiB
Python
69 lines
2.6 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""PLAN 291-1 — 구조물 배치: 새 구조물은 [추가] 누른 뒤에만 생김.
|
|
|
|
A군(관 지점 정본) — 기준 측점 확정(`commitPosition`)은 관을 안 넣음 · 우클릭 「추가」(116-1)만
|
|
임시 배치를 만듦 · [추가](`commit`)가 관 정본에 넣음. B · C 군은 [추가] 전 기록이 없음(`liveCommit` 이
|
|
고르던 항목만). 세월교 · 물넘이 빈 월류 높이는 [추가] 뒤 재계산 유량으로 채움(126-1 `fordWaits`).
|
|
"""
|
|
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
B05 = ROOT / "B05_Profile"
|
|
|
|
|
|
def _read(name: str) -> str:
|
|
return (B05 / name).read_text(encoding="utf-8")
|
|
|
|
|
|
def _body(src: str, start: str, end: str) -> str:
|
|
at = src.index(start)
|
|
return src[at : src.index(end, at)]
|
|
|
|
|
|
PANEL = _read("B05_Profile_UI_Structures_Panel.ts")
|
|
|
|
|
|
def test_임시_배치는_create_일_때만_관을_넣음():
|
|
body = _body(
|
|
PANEL, "function commitTempPipe(create = false): void {", "function handleStationInput"
|
|
)
|
|
guard = body.index("if (!create) return;")
|
|
add = body.index("callbacks.onPipeAdd(anchor, attributes);")
|
|
assert body.index("if (tempPipeChainage === null) {") < guard < add
|
|
# 이미 있는 임시 관(우클릭)은 기준 측점으로 옮김 그대로
|
|
assert "callbacks.onPipeUpdate(from, anchor, attributes);" in body
|
|
|
|
|
|
def test_측점_확정은_관을_안_만듦():
|
|
body = _body(PANEL, "function commitPosition(): void {", "function renderOptionFields")
|
|
assert "commitTempPipe();" in body
|
|
assert "commitTempPipe(true)" not in body
|
|
|
|
|
|
def test_우클릭_추가만_임시_배치_만듦():
|
|
body = _body(PANEL, " addAt(chainageM, typeId) {", " moveById(")
|
|
assert "if (type.managed_by) commitTempPipe(true);" in body
|
|
assert PANEL.count("commitTempPipe(true)") == 1
|
|
|
|
|
|
def test_추가_단추가_관_정본에_넣음():
|
|
commit = _read("B05_Profile_UI_Structures_Panel_Commit.ts")
|
|
body = _body(commit, "export async function commit(", "const placement = type.placement;")
|
|
assert "ctx.callbacks.onPipeAdd(anchor, attributes);" in body
|
|
|
|
|
|
def test_고르던_항목만_실시간_반영():
|
|
body = _body(PANEL, "function liveCommit(): void {", "function commitSummary")
|
|
assert "if (!editingId && selectedPipeChainage === null) return;" in body
|
|
|
|
|
|
def test_새_세월교_물넘이_월류_높이는_추가_뒤_채움():
|
|
drainage = _read("B05_Profile_UI_Drainage_Panel.ts")
|
|
body = _body(drainage, " addPipe(chainageM, attributes) {", " updatePipeFacility(")
|
|
assert "fordWaits().add(chainageM)" in body
|
|
|
|
|
|
def test_패널_700줄_안():
|
|
assert len(PANEL.splitlines()) <= 700
|