Files
Aislo/resources/tester/test_166_6_b09_daega_blank.py
T
eomsangdonandClaude Opus 5.5 5d8d9a4fd3 test(841-1): B09 = M02 값 — 산근 · 대가 · 고정 줄 셈 다듬기 · 낡은 시험 정리 — C 걸음
코드
- 고정 줄 단가 = M02_Labor_Fixed.line(사본 묶음 · 이은 노임 · 자재 = 묶음 값) — B09 단가 책으로 다시 안 덮음
- 대가 · 산근 고친 칸 = 품만 실제로(단가 칸 덮기 줄 남던 흠 · 품 고친 뒤 줄 금액 다시 셈 흠 py · ts 짝)
- 산근 글 = 엔진 단가 셈 그대로 · 별도계상 재료 줄 끝 「· 별도계상 = 0.0」 · 계 줄 = 블록 합
- 노무비 · 중기목록 이름에서 규격 겹침 뗌 · TS 바탕 셈 이름 PARTS → MACHINE_PARTS(짝 시험이 TS 를 이어 붙일 때 겹침)

시험(고친 까닭 = 단가 원천이 B09 책 → M02 엔진 · 노임 · 기계 덮개 · 단가 고친 칸 · 중기사용료 걷음)
- 144 바탕 · 뼈대: 운전사 · 중기사용료 · 경비 · 덮개 시험 걷음 → 노무 · 중기 나열 · 사급 표시 · 자재만 책
- 145-1 · 145-2 · 155 · 157-1 · 166-2 · 166-6 · 719-3 · 719-4 · 723-4 · 778-4 · 792-3: 줄 단가 = own(엔진) · 산근 = Solver() · collect 새 부름 꼴
- 702 · 705-1 · 719-2: 단가 칸 덮개 = 안 읽음 · 고정 줄 = M02 셈(노임 새 판 따라가기 시험 걷음)
- 203-1 · 296 · 703-3 · 795-4: 단가 책 = 자재 줄로
- 707 · 707-6 · 707-7: 단가표 불러오기 = 자재만 · 거창 이은 안내판 줄 = M02 사본 셈(엑셀 −50,000)
- 201-1: 환율 · 중기사용료 표 걷음 · b09 저장 속도: 산근 앞 풀이 그대로(단가 표 같음 견줌 걷음)
- 대상 113 파일 764 통과 · 25 실패 = 원래 실패(formatMoney · formatPrice 없음 · 단위 글 ㎜ · sec · 719-1 · 796-2e · 717-4 · 721 · 311 · 243 · 246)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:57:01 +09:00

102 lines
3.9 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""166-6 일위대가목록표 블록 합 — 빈 줄 있는 블록 = 아는 줄 합 + 「빈 줄 n」 · 내역 단가엔 안 넘김.
견본 = 대가 A(노무 아는 줄 · 자재 단가 없음 줄) · 대가 B(A 를 부름 → 그 줄도 빈 줄) · 대가 C(빈 줄 없음).
파이썬 `B09_Estimation_Calc_Labor` ↔ TS 짝 거울 + 목록표 화면 「빈 줄 n」 · 풍선(Node 타입 지움).
"""
import json
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from B09_Estimation.B09_Estimation_Calc_Labor import compute_labor, daega_price # noqa: E402
from test_145_2_b09_labor_calc import _same, _ts # noqa: E402
from test_155_b09_tabs import _node # noqa: E402
SHEETS = {
"labor": [{"key": "L1", "price": 165545}],
"material": [{"key": "M1", "price": None}],
"machine": [],
"gaps": [],
}
#: 841-1 줄 단가 = M02 엔진(`own`) · 자재 단가 없음 = own None
LABOR = {"labor": 165545}
def _b(bid, name, lines):
return {
"id": bid,
"kind": "조합",
"name": name,
"spec": "",
"unit": "m",
"cite": "",
"lines": lines,
}
DAEGA = {
"blocks": [
_b("A", "기슭막이", [
{"kind": "labor", "key": "L1", "qty": 0.5, "name": "보통인부", "own": LABOR},
{"kind": "material", "key": "M1", "qty": 2, "name": "토목용부직포", "own": None},
]),
_b("B", "겹 대가", [
{"kind": "labor", "key": "L1", "qty": 0.1, "name": "보통인부", "own": LABOR},
{"kind": "daega", "key": "A", "qty": 1, "name": "기슭막이"},
]),
_b("C", "아는 줄만", [{"kind": "labor", "key": "L1", "qty": 1, "name": "보통인부", "own": LABOR}]),
],
"owners": {"pipe@100.0": "A", "pipe@200.0": "C"},
} # fmt: skip
def test_아는_줄_합_빈_줄_n():
out = compute_labor(DAEGA, SHEETS)
rows = {r["key"]: r for r in out["daega"]}
# 165,545 × 0.5 = 82,772.5 → 블록 ROUNDDOWN 0 · 자재 줄은 빈 줄
assert (rows["A"]["sum"], rows["A"]["labor"], rows["A"]["material"]) == (82772, 82772, 0)
assert (rows["A"]["blank"], rows["A"]["blank_names"]) == (1, ["토목용부직포"])
# 부른 대가에 빈 줄 → 그 줄도 빈 줄(아는 줄 합을 위로 안 넘김)
assert (rows["B"]["sum"], rows["B"]["blank"], rows["B"]["blank_names"]) == (
16554,
1,
["기슭막이"],
)
assert (rows["C"]["sum"], rows["C"]["blank"]) == (165545, 0)
# 목록표 = 블록 합계 그대로(같은 셈 한 벌)
for b in out["daega_blocks"]:
assert _same(
{k: rows[b["key"]][k] for k in ("sum", "blank")}, {"sum": b["sum"], "blank": b["blank"]}
)
# 내역 단가 = 빈 줄 블록은 빈칸 · 없는 블록은 그대로
assert daega_price(out, "pipe@100.0")["sum"] is None
assert daega_price(out, "pipe@100.0")["labor"] is None
assert daega_price(out, "pipe@200.0")["sum"] == 165545
def test_거울_파이썬_TS():
py = json.loads(json.dumps(compute_labor(DAEGA, SHEETS), ensure_ascii=False))
ts = _ts(DAEGA, SHEETS, {})
assert _same(py, ts["out"])
assert _same(daega_price(py, "pipe@100.0"), ts["price"])
def test_목록표_빈_줄_글_풍선():
sheets = json.dumps(compute_labor(DAEGA, SHEETS), ensure_ascii=False)
out = _node(
f"\nconst t = buildDaegaList({{ sheets: {sheets} }});"
"\nconsole.log(JSON.stringify({ notes: t.rows.map((r) => r.blank_note),"
" sums: t.rows.map((r) => r.sum), cols: t.columns.map((c) => c.key),"
" tips: t.rows.map((_, i) => t.tip(i, 'blank_note') ?? null) }));"
)
assert out["cols"][5:7] == ["sum", "blank_note"] # 합계 바로 옆
assert out["notes"] == ["빈 줄 1", "빈 줄 1", ""]
assert out["sums"] == [82772, 16554, 165545]
assert out["tips"] == ["빈 줄 — 토목용부직포", "빈 줄 — 기슭막이", None]