- 정본 = 장 파일 머리 「차례」(order_chapters) — 건설 공통·토목·건축·기계설비·유지관리 → 산림 → 자체 로 다시 매김(소요량 · 계수 · 로직 144 파일 머리 한 줄씩) - 「차례」 없는 파일(자체)은 맨 뒤 — chapter_order 한 곳 · M01 목록 · 로직 목록 · M02 기준 목록 셈 순서가 같이 따름 - 낡은 시험 test_m01_api 의 산림 먼저 단정 2 줄 고침 · 지킴 시험 test_843_book_order 추가 - 로직 내용 · 키 · 금액 그대로 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
23 lines
896 B
Python
23 lines
896 B
Python
"""843 — 단가산출 기초 목록 책 차례: 건설품셈 → 산림품셈 → 자체 (소요량 · 계수 · 로직 · 장 파일 머리 「차례」)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from M01_MasterData import M01_MasterData_Store as store
|
|
|
|
RANK = {"건설품셈": 0, "산림품셈": 1, "자체": 2}
|
|
|
|
|
|
@pytest.mark.parametrize("group", ["소요량", "계수", "로직"])
|
|
def test_책_차례_건설_산림_자체(group: str) -> None:
|
|
books = [store.read(f["file"])[0].get("원문") for f in store.files_of(group)]
|
|
ranks = [RANK[b] for b in books]
|
|
assert ranks == sorted(ranks) and 0 in ranks and 1 in ranks
|
|
|
|
|
|
def test_구분_목록도_건설_먼저() -> None:
|
|
names = [s["name"] for s in store.subs(group="로직")["subs"]]
|
|
assert names.index("건설품셈 공통") < names.index("산림품셈")
|
|
assert names[-1] in ("산림품셈", "자체")
|