"""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 ("산림품셈", "자체")