Files
Aislo/resources/tester/test_masshaul_single_source.py
T
eomsangdonandClaude Opus 5.5 dd80662750 refactor(B05·B06): 옛 B06 계획선 편집 껍데기 정리 · 유토 뱃지 한 계산(PLAN 24-2a 덧붙임)
- B06_Section_UI_Page_Grade_Edit.ts 삭제 · 페이지 배선 · Section_View setGradeEdit · LegacyGradeEdit 제거
  (▲▼ 는 종단도 한 벌 · 계획고 가게는 노선마다 한 벌 — useProfileEditStore 도 걷음)
- 구조물 폐회로 면적을 재계산 창구(refreshCrossDesigns) 한 자리에서 얹음 — B05 · B06 유토 뱃지 같은 값
  (실측 전 B05 −14,144.5 · B06 −12,533.2 → 후 두 보기 −12,993.7 · B06 편집 뒤 −12,952.9)
- 시험: test_masshaul_single_source 에 한 자리 잠금 추가

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmELpdXFDRZHhfbGuRhSmL
2026-09-29 21:02:02 +09:00

78 lines
3.5 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""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("B06_Section/B06_Section_UI_Page.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
for source in (B05_PREVIEW, B06_PAGE):
assert "refreshCrossDesigns(" 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