"""노체다짐 칸 — 기본 꺼짐 · 켜면 토공집계 별도 줄 · 수량 = 성토량 (2026-09-13 판정).""" from __future__ import annotations import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[2] sys.path.insert(0, str(ROOT)) from B08_Quantity.B08_Quantity_Engine_EarthworkSummary import SummaryInput, build_rows # noqa: E402 TOTALS = {"fill_volume_m3": 1234.5} def _groups(enabled: bool) -> dict: rows = build_rows(SummaryInput(earthwork_totals=TOTALS, subgrade_compaction_enabled=enabled)) return {row.group: row for row in rows} def test_끄면_줄_자체가_없다() -> None: assert "노체다짐" not in _groups(False) def test_켜면_성토량으로_선다_근거가_비고에() -> None: row = _groups(True)["노체다짐"] assert (row.unit, row.amount, row.in_bill) == ("㎥", 1234.5, True) assert "[주]⑤" in row.note and "층다짐이 필요한 경우" in row.note assert "굴착기" not in row.spec # 굴착기는 성토(포설) 줄이 셈 — 두 번 안 셈 def test_인계가_9_16_2_로_잇고_갈래를_안_싣는다() -> None: from B08_Quantity.B08_Quantity_Engine_EarthworkSummary import build_table from B08_Quantity.B08_Quantity_Engine_Handoff import build_handoff table = build_table(SummaryInput(earthwork_totals=TOTALS, subgrade_compaction_enabled=True)) handed = {r["name"]: r for r in build_handoff(summary_table=table)["work_items"]} row = handed["노체다짐"] assert (row["work_item_code"], row["quantity"], row["in_bill"]) == ("FP-09-16-02", 1234.5, True) assert row["variant_value"] is None and row["blocked_kind"] is None def test_설정_기본은_꺼짐() -> None: from common_util.common_util_project_settings import default_settings assert default_settings()["quantity"]["subgrade_compaction_enabled"] is False