Files
Aislo/resources/tester/test_b06_draft_pipe_replay.py
T
eomsangdonandClaude Sonnet 5.5 45a22c5d72 fix(B05·B06): 저장 전 관 옵션 초안이 새로고침 뒤 폼 · 카드에 살아남음(PLAN 24-7a)
원인 — 횡단 캐시 상세(section-detail)는 저장분이라 새로고침 뒤 월류 폭 · 관경 같은 스펙 값이
저장값으로 돌아오고, 폼(withSpecDefaults)은 스펙을 초안 옵션보다 앞세워 초안 3.5 대신 10 을 보임.
또 횡단 보기가 먼저 선 뒤 종단 보기가 서면 관 목록을 못 받은 채 구조물 로딩이 관을 지워 초안 옵션이 사라짐.

- 횡단 보기가 서며 관 초안 옵션을 캐시 스펙에 다시 얹음(조정창 정본인 기슭막이 높이 · 형태는 제외)
- 배수유역도가 마지막으로 알린 관 목록을 한 벌 자리에 기억해 뒤에 서는 종단 보기가 먼저 실음
- 시험 test_b06_draft_pipe_replay 1건

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ly2oHAaTDYRjcniAmHR81z
2026-09-29 23:33:57 +09:00

48 lines
2.4 KiB
Python

# -*- coding: utf-8 -*-
"""저장 전 관 옵션 초안 되얹기 회귀검증 — PLAN 24-7a (2026-09-29).
새로고침하면 횡단 캐시 상세는 저장분이라, 저장 전에 고친 월류 폭 · 관경이 폼 · 카드에서
저장값(월류 폭 10 · 관경 1000)으로 돌아가 있었다. 초안(관 목록 세션 초안)이 정본이므로
횡단 보기가 서며 초안 관 옵션을 캐시에 다시 얹는다.
• 되얹기 — 세월교 월류 폭 3.5 · 배수관 관경 1200 이 캐시 스펙에 실림 · 조정창 정본(기슭막이 높이 · 형태)은 안 건드림
• 횡단 보기가 먼저 선 뒤 종단 보기가 서도 종단 보기가 배수유역도의 관 목록을 먼저 쥠(빈 목록으로 시작해 관을 지우지 않음)
화면 그릇 없이 Node 헬퍼가 TS 를 트랜스파일해 돌린다(`helper_b06_draft_pipe_replay.cjs`).
"""
import json
import os
import subprocess
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = os.path.abspath(os.path.join(HERE, "..", ".."))
def _read(*parts: str) -> str:
with open(os.path.join(ROOT, *parts), encoding="utf-8") as handle:
return handle.read()
def test_draft_pipe_options_are_replayed_onto_the_cache():
proc = subprocess.run(
["node", os.path.join(HERE, "helper_b06_draft_pipe_replay.cjs")],
capture_output=True,
text=True,
timeout=60,
)
assert proc.returncode == 0, proc.stderr
out = json.loads(proc.stdout)
assert out["fordSpan"] == 3.5 # 월류 폭 초안이 캐시 스펙에 실림(저장분 10 아님)
assert out["culvertDiameter"] == 1.2 # 배수관 관경 초안 1200
assert out["fordCalls"] == 1 # 옵션 없는 관은 건드리지 않고 세월교는 한 번만
assert out["revetTouched"] is False # 기슭막이 높이 · 형태는 조정창이 정본
# 배선 — 횡단 보기가 서며 초안을 읽어 되얹고, 종단 보기는 마지막 관 목록을 먼저 싣는다.
cross = _read("A00_Common", "design", "design_view_cross.ts")
assert "replayDraftPipeOptions(pipeOptionsContext, readPendingPipes(projectId))" in cross
shared = _read("A00_Common", "design", "design_shared.ts")
assert "shared.lastPipes = pipes" in shared
profile = _read("A00_Common", "design", "design_view_profile.ts")
assert profile.index("if (lastPipes) applyPipes(lastPipes)") < profile.index(
"await bridge.load();\n advanceLoading"
)