test(B06): 측구 선택이 캐시·재계산·저장 patch 네 통로에 실리는지 잠금

화면 실측에서 토글이 안 돌던 까닭이 「칸 하나 빠짐」이었음 — 통로 어느 한 곳만
빠져도 눌린 값이 조용히 사라지므로 네 파일을 함께 지킴. patch 병합이 「끔」(False)을
걷지 않는 것도 함께 봄.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-09 20:40:29 +09:00
co-authored by Claude Opus 5
parent 79bc4055f9
commit a3d73fcf5c
+25
View File
@@ -87,3 +87,28 @@ def test_양성은_선택보다_기하가_먼저다() -> None:
ditch_choice=True,
)
assert design["ditch_enabled"] is False
def test_선택이_저장_patch_까지_실린다() -> None:
"""⚠ 2026-09-09 화면 실측으로 잡은 자리 — 토글을 눌러도 **아무 일도 안 났다.**
선택이 캐시(`CrossDesignChoice`)·재계산(`Cross_Refresh`)·저장 patch 어느 쪽에도
실리지 않아 **눌린 값이 그 자리에서 버려졌다.** 칸 하나가 빠지면 조용히 사라지므로
통로 네 곳을 함께 지킨다.
"""
from B06_Section.B06_Section_Schema import CrossSectionPatch
patch = CrossSectionPatch(chainage_m=20.0, ditch_choice=False)
dumped = {k: v for k, v in patch.model_dump().items() if v is not None}
assert dumped["ditch_choice"] is False, "「끔」이 병합에서 걷혀 정본에 안 남는다"
def _reads(name: str) -> str:
return (PROJECT_ROOT / "B06_Section" / name).read_text(encoding="utf-8")
for name in (
"B06_Section_Cross_Design_Session.ts", # 캐시 칸
"B06_Section_UI_Page.ts", # 캐시에 쓰는 자리
"B06_Section_Cross_Refresh.ts", # 브라우저 재계산이 읽는 자리
"B06_Section_UI_Page_Persist.ts", # [저장]·[확정] patch
):
assert "ditch_choice" in _reads(name), f"{name} 에서 측구 선택이 빠졌다"