"""M01 로직 원문 — 출처 글 → 품셈 본문 절(44-4). 원본은 읽기만.""" from __future__ import annotations import json from fastapi import FastAPI from fastapi.testclient import TestClient from M01_MasterData import M01_MasterData_Router as router_module from M01_MasterData import M01_MasterData_Store as store from M01_MasterData import M01_MasterData_Store_Make as make def test_build_civil_section_with_table() -> None: got = make.source("건설품셈 토목 1-1-2") assert len(got["found"]) == 1 one = got["found"][0] assert one["matched"] == "1-1-2" assert one["file"].startswith("원가계산/건설공사_표준품셈/본문/02_토목부문/제01장_") assert one["blocks"][0]["h"] == 3 and one["blocks"][0]["text"].startswith("1-1-2 유도선") table = next(b["table"] for b in one["blocks"] if "table" in b) assert table[0][0] == "구분" and ["특별인부", "인", "2", "1,350", "1,560"] in table # 다음 절(1-1-3 …) 앞에서 끊김 · 주석 줄 뺌 assert not any("1-1-3" in b.get("text", "") for b in one["blocks"]) assert not any(b.get("p", "").startswith("