Files
Pier_v1/Code/교각모델링앱/tools/test_rampa_web.py
T
ahnyongjooandClaude Sonnet 5.5 964a841de1 chore(rebar): Pier_T_rebar 작업 폴더 초기 구성 및 외부 의존 파일 통합
- Code\rebar_pipeline, review_pipeline, pier-program을 정션에서 실제 폴더로 전환
- Code\rhino_mcp 및 CLAUDE_rhino배경.md 추가, .mcp.json은 PYTHONPATH로 새 위치 사용
- pier-program 내부 .git 제거(이력은 backup\pier-program_20261028.bundle에 보관)
- worktree 가이드 반영(CLAUDE.local.md, HANDOFF.md)
- D:\Rhino-MCP 경로 참조를 새 위치로 치환

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 11:20:18 +09:00

49 lines
2.3 KiB
Python

"""Ramp-A P1 app flow without Rhino (2026-10-14): a copy of data/Ramp-A교P1 in 검증/rampa_web_data (recreated).
Checks that the drilled-shaft form is not blocked by sections it does not have (lean concrete, footing, footing
rebar), that its own sections (pile, shaft_rebar) need confirmation, and that confirming every required bundle clears G1."""
import os
import shutil
import sys
from pathlib import Path
APP = Path(__file__).resolve().parents[1]
TD = APP / "검증" / "rampa_web_data"
if TD.exists():
shutil.rmtree(TD)
shutil.copytree(APP / "data" / "Ramp-A교P1", TD / "램프", ignore=shutil.ignore_patterns("runs", "backup", "confirm.json"))
os.environ["PIERAPP_DATA"] = str(TD)
sys.path.insert(0, str(APP / "web"))
import app as webapp # noqa: E402
sys.path.insert(0, str(Path(__file__).resolve().parent))
from testlib import confirm_required # noqa: E402
import store # noqa: E402
ok = True
def check(name, cond, detail=""):
global ok
ok &= bool(cond)
print("PASS" if cond else "FAIL", name, str(detail)[:300], flush=True)
p = store.Pier("램프")
check("scope G1~G5", p.scope() == ["G1", "G2", "G3", "G4", "G5"], p.scope())
missing = [b for g in p.scope() for b in webapp.gate_blockers(p, g) if b.endswith("없음")]
check("no gate blocked by an absent section", not missing, missing)
need = {k for _, k in webapp.unconfirmed(p)}
check("pile and shaft_rebar need confirmation", {"pile", "shaft_rebar"} <= need, sorted(need))
check("absent footing sections not required", not ({"lean_concrete", "footing", "footing_rebar", "piles"} & need))
c = webapp.app.test_client()
confirm_required(c, webapp, store, "램프", "시험")
p = store.Pier("램프")
check("confirming every required bundle clears all required", webapp.unconfirmed(p) == [], webapp.unconfirmed(p))
check("G1 not blocked after confirming every required bundle", webapp.gate_blockers(p, "G1") == [], webapp.gate_blockers(p, "G1"))
check("G2 waits only for G1 approval", webapp.gate_blockers(p, "G2") == ["G1 미승인"], webapp.gate_blockers(p, "G2"))
r = c.get("/pier/램프")
h = r.get_data(as_text=True)
check("pier page renders with the pile section", r.status_code == 200 and "params.pile" in h.replace("/", ".") or "pile" in h, r.status_code)
shutil.rmtree(TD)
print("RESULT", "PASS" if ok else "FAIL")
sys.exit(0 if ok else 1)