Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
30 lines
1.3 KiB
Python
30 lines
1.3 KiB
Python
"""수량 자리 맞춤 골든 대조 — STmate 실무 원본 내역 수량이 우리 자리 규칙으로 **안 바뀌어야** 함.
|
|
|
|
2026-09-14 브레인 판정 — 내역 수량은 1-2-2 자리로 반올림해 확정한 뒤 금액(버림). 골든 금액 시험
|
|
(`test_b09_golden_stmate`)은 원본 수량을 `bill_line` 에 바로 넣어 이 길을 안 거치므로, 원본 수량
|
|
자체로 자리 규칙을 따로 잰다(321줄 · 철근 ton 소수 3자리가 이 대조에서 드러남).
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
from test_b09_golden_stmate import _bill_rows, _num
|
|
|
|
from B09_Estimation.B09_Estimation_QuantityDigits import round_quantity
|
|
|
|
|
|
def test_실무_원본_내역_수량이_자리_규칙으로_안_바뀐다() -> None:
|
|
rows = _bill_rows()
|
|
if not rows:
|
|
pytest.skip("실무 원본 XLSX 가 없음")
|
|
changed = []
|
|
for name, row in rows:
|
|
quantity, unit = _num(row[3]), str(row[4] or "").strip()
|
|
if quantity is None or unit == "%":
|
|
continue
|
|
settled, digits = round_quantity(quantity, str(row[1] or ""), unit, str(row[2] or ""))
|
|
if settled != quantity:
|
|
changed.append((name, row[1], unit, str(quantity), digits))
|
|
assert len(rows) >= 300, len(rows)
|
|
assert not changed, (len(changed), changed[:5])
|