Files
Aislo/resources/tester/test_masshaul_single_source.py
T
eomsangdonandClaude Opus 5 0ef32b5279 chore(tester): 시험을 resources/tester/ 로 옮김 — 창끼리 건너가게
⚠ **뿌리** — `tmp/` 는 창 사이에 안 건너감(실측 확인: 상대 창이 놓은 `tmp/_sync_probe.txt`
가 시간을 두고 두 번 봐도 안 보임). 그래서 **정본(등록부 스키마)만 건너가고 그것을 읽는
시험은 안 건너가** 오늘 두 번, 같은 시험이 **연 창은 통과·받은 창은 실패**가 됐음.

- `tmp/tests/*` 를 `resources/tester/` 로 **복사**(127 파일). 내용은 **한 줄도 안 고침**
- `tmp/tests` 는 **남겨 둠** — 되돌릴 자리(사용자 지시)
- 실행: `./venv/Scripts/python.exe -m pytest resources/tester/ -q`
  옮기기 전과 **같은 수**: 617 통과 / 22 건너뜀 / 실패 0

⇒ 이제 시험·예외·까닭이 **정본과 함께** 움직임. 오늘 세운 「예외는 정본 스키마에」와 짝임.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-09 17:12:30 +09:00

64 lines
2.7 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")
B06_PAGE = _read("B06_Section/B06_Section_UI_Page.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 의 보존 필드 목록