- Hopyo_View basisOk(후보 근거, 줄 근거) — 앞 마디 같음은 근거 맞음 아님 · 엑셀 직종 없는 줄(기계)도 조항 같음 + 단위면 맞음 · basisPick · 고르기 창 꼬리표가 줄 근거를 넘김 - 시험 screen(앞 마디 · 보통인부뿐 · 직종 없음) · seam(북부청 실제 응답 1순위 근거 맞음 123 = 서버 기준 · 앞 마디 0) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
56 lines
2.5 KiB
Python
56 lines
2.5 KiB
Python
"""일위대가 실무자료 이음매(PLAN 329 · 330) — 실제 서버 응답(북부청 격자 · 호표 맞춤)을
|
|
화면 도우미(`helper_m02_hopyo_seam.cjs` → Hopyo_Sheet · Hopyo_View)에 먹임.
|
|
|
|
행 22 → 제3호표 · 25 빈 줄 · 26 → 제4호표 · 영역 B20:O24 · 단산93 행 4229:4244 ·
|
|
엑셀 근거 줄 · 근거 꼬리표 · 근거 맞음 대상 · 북부청 「후보」 줄 1순위 근거 맞음 = 서버 기준 123 ·
|
|
앞 마디 같음 0(330 덧고침 2).
|
|
"""
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
|
|
from resources.tester import test_m02_hopyo_excel as base
|
|
from resources.tester.test_m02_hopyo_excel import URL, _post
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
client = base.client # 공용 고정물(임시 층)
|
|
|
|
|
|
def _node(payload: dict) -> dict:
|
|
proc = subprocess.run(
|
|
["node", os.path.join(HERE, "helper_m02_hopyo_seam.cjs")],
|
|
input=json.dumps(payload, ensure_ascii=False),
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
check=False,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
return json.loads(proc.stdout)
|
|
|
|
|
|
def test_실제_응답_화면_도우미(client):
|
|
assert _post(client).status_code == 200
|
|
grid = client.get("/api/m02/layers/personal/hopyo-grid/HP-000001").json()
|
|
lines = []
|
|
for no in (3, 12, 38, 58):
|
|
res = client.get(f"{URL.format('personal')}/HP-000001/{no}").json()
|
|
lines += [x for x in res["호표"]["줄"] if x.get("근거")]
|
|
every = []
|
|
for one in grid["호표"]:
|
|
res = client.get(f"{URL.format('personal')}/HP-000001/{one['번']}").json()
|
|
every += [x for x in res["호표"]["줄"] if x["갈래"] == "단가산출"]
|
|
got = _node({"grid": grid, "lines": lines, "all": every})
|
|
assert got["count"]["top"] == 123 and got["count"]["half"] == 0
|
|
assert got["count"]["pick"] >= 123
|
|
assert got["at"] == [None, 3, 3, 3, None, 4] # 25행 = 호표 사이 빈 줄
|
|
assert got["span"] == "B20:O24" and got["rows"] == "4229:4244"
|
|
by = {x["이름"]: x for x in got["lines"]}
|
|
dig = by["구조물터파기(인력100%)"]
|
|
assert dig["source"] == "출처 건설품셈 3-2-1 · 직종 특별인부 · 단가산출 4229–4244행"
|
|
assert dig["tag"] == "조항 건설품셈 공통 3-2-1 · 직종 특별인부 · 단위 같음"
|
|
assert dig["ok"] is True and dig["pick"] == "GC000083"
|
|
assert by["비탈면 보호공"]["pick"] == "GC000143"
|
|
assert by["흙깍기(토사)"]["ok"] is True # 엑셀 직종 없는 줄(기계) = 조항 같음 + 단위
|