- 다시 셈(refreshCrossDesigns) 부르는 곳 = 묶음 cross 단계 하나(design_shared savedCross) - 종단 미리 셈 · B06 설계 맞춤 · 3D 업데이트 = pipelineCross · reconcilePagePipeline(▲ 한 번 = cross 한 번) - 입력 칸 밖 세션 고침(노견 · 소단 · 단면 유형 · 조정창)은 forceCross 로 같은 입력이어도 한 번 더 - 카드 그리기 · 횡단 보기 면적 쓰기 지움 · 다시 셈 창구가 면적을 늘 얹음(바뀐 측점만 알림) - 저장 안 한 조정창 값을 상세 가게가 읽을 때 얹음(새 Section_Adjusts · B05 만 열어도 같은 면적) - 새 test_384_4_cross_window · 옛 약속 시험 넷 새 약속으로 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014utrjfoW831Vc5wJUd13kL
84 lines
4.0 KiB
Python
84 lines
4.0 KiB
Python
"""B05·B06 유토곡선 일원화 소스 검사 (2026-09-03 사용자 지시).
|
||
|
||
같은 데이터를 두 화면에 보여 주는 기능이므로 ① 보는 노선 ② 횡단 재계산 창구
|
||
③ 낡음 판정 규칙이 한 벌이어야 한다. 실측으로 드러난 갈림:
|
||
· 노선 — B05 route 126(DRAFT) / B06 route 125(CONFIRMED), 20m 성토 4.82㎡ ↔ 85.9㎡
|
||
· 재계산 — B06만 표준 단면값·암 경계 오프셋을 실어 보냄, 절토 합 228.52㎡ ↔ 270.12㎡
|
||
"""
|
||
|
||
from pathlib import Path
|
||
|
||
ROOT = Path(__file__).resolve().parents[2]
|
||
|
||
|
||
def _read(relative: str) -> str:
|
||
return (ROOT / relative).read_text(encoding="utf-8")
|
||
|
||
|
||
REPO = _read("B06_Section/B06_Section_Repository.py")
|
||
B06_ROUTER = _read("B06_Section/B06_Section_Router.py")
|
||
REFRESH = _read("B06_Section/B06_Section_Cross_Refresh.ts")
|
||
B05_PREVIEW = _read("B05_Profile/B05_Profile_UI_Profile_Preview.ts")
|
||
# 설계 재계산 자리는 700줄 제한으로 `_UI_Page_Design_Sync` 로 떨어져 나갔다(2026-09-13).
|
||
B06_PAGE = _read("A00_Common/design/design_view_cross.ts") + _read(
|
||
"B06_Section/B06_Section_UI_Page_Design_Sync.ts"
|
||
)
|
||
|
||
|
||
def test_workflow_route_context_has_no_confirmed_filter():
|
||
"""화면이 보는 경로는 최신 경로 — 확정 여부로 거르지 않는다."""
|
||
assert "async def get_workflow_route_context" in REPO
|
||
assert "confirmed_only=False" in REPO
|
||
# 확정본만 보는 창구(B07 납품도면)는 그대로 남아 있어야 한다.
|
||
assert "async def get_confirmed_route_context" in REPO
|
||
assert "confirmed_only=True" in REPO
|
||
|
||
|
||
def test_b06_context_uses_workflow_route():
|
||
"""B06 화면 context는 B05와 같은 최신 경로를 돌려준다."""
|
||
# 2026-09-06 부터 이 읽기는 `asyncio.gather` 로 묶여 커넥션 인자가 사라졌다
|
||
# (`run_with_connection` 이 자기 커넥션을 넘긴다). 확인할 것은 **어느 창구를 쓰는가**다.
|
||
assert "get_workflow_route_context" in B06_ROUTER
|
||
assert "get_confirmed_route_context" not in B06_ROUTER
|
||
|
||
|
||
def test_cross_refresh_is_single_entry():
|
||
"""횡단 재계산은 한 창구뿐 — 두 화면이 같은 인자를 실어 보낸다."""
|
||
assert "export async function refreshCrossDesigns" in REFRESH
|
||
assert "readStandardCrossSession(projectId)" in REFRESH
|
||
assert "readRockBoundarySession(projectId, routeId)" in REFRESH
|
||
# 부르는 곳 = 계산 묶음 cross 단계 하나(design_shared savedCross · 387-4) — 화면은 묶음에 부탁
|
||
shared = _read("A00_Common/design/design_shared.ts")
|
||
assert shared.count("refreshCrossDesigns(") == 1
|
||
for source in (B05_PREVIEW, B06_PAGE):
|
||
assert "refreshCrossDesigns(" not in source
|
||
assert "previewCrossDesigns(" not in source
|
||
|
||
|
||
def test_cross_refresh_preserves_user_fields():
|
||
"""서버 설계로 갈아 끼워도 화면 조작으로만 생기는 값은 살아남는다."""
|
||
for field in (
|
||
"inlet_structure",
|
||
"basin_adjust",
|
||
"revet_adjust",
|
||
"extra_wall_counts",
|
||
"extra_spans",
|
||
"revet_link_detached",
|
||
"revet_follow_grade",
|
||
):
|
||
assert f'"{field}"' in REFRESH # preserveUserFields 의 보존 필드 목록
|
||
|
||
|
||
def test_cross_refresh_lays_structure_areas_once():
|
||
"""구조물 폐회로 면적은 재계산 창구 **한 자리**에서 얹는다(계획서 24-2a).
|
||
|
||
부르는 쪽(B05 프리뷰 · B06 설계 맞춤)마다 얹으면 B06 흐름만 얹고 B05 는 안 얹어 두 보기의
|
||
유토 뱃지가 갈렸다(실측 B05 −14,144.5 · B06 −12,533.2㎥)."""
|
||
body = REFRESH[REFRESH.index("export async function refreshCrossDesigns") :]
|
||
body = body[: body.index("\n}\n")]
|
||
assert "applyStructureAreaRows(" in body and "structureAreaRows(" in body
|
||
assert "applyStructureAreaRows(" not in B05_PREVIEW
|
||
# 화면(횡단 보기 · 카드 그리기)은 면적을 안 고침 — 카드 안 그려도 면적 같음(387-4)
|
||
assert "applyStructureAreaRows(" not in B06_PAGE
|
||
assert "applyStructureAreas" not in _read("B06_Section/B06_Section_UI_Cross_View.ts")
|