Files
Aislo/resources/tester/test_782_1_carry_127.py
T
eomsangdonandClaude Opus 5.5 2123d43773 test(855-E 2-E4 ㉯-1): 로직 JSON 걷은 뒤 깨진 시험 셋 묶음 — 782 check_master · 713_4 · 855_l2b
- helper_855_engine.master_files(이름들) = check_master.load 꼴 · 옛 로직 파일 이름 = 같은 장 수식 문서 줄(M01_MasterData_Doc.logic_files)
- test_782_1 · 782_2 · 782_3: check_master 시험 = 로직 파일 대신 문서 줄 · 옛 check_logics → check_docs(문서 막힘 · 키 겹침 · 연결) · 목차 대조(check_master_toc) = 문서 줄로 그대로 · 782_3 장 끝 셈 = 문서 기본 입력 셈 됨(옛 시험입력 걷힘)
- test_713_4: 조종원 세 계수 = 수식 문서 글 · 옛 로직 일괄 시험계산(calc_all · 걷힘) 단언 지움
- test_855_l2b_copy_plain: 옛 저장본 로직 줄 = 손 견본(로직 JSON 없음)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 14:59:50 +09:00

102 lines
3.8 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.
# -*- coding: utf-8 -*-
"""782-1 건설 공통 1-2-7 운반 기초 — 계수 표 여덟 · 로직 셋 · 실무 소운반 재현 넷 · check_master."""
import sys
from decimal import Decimal
from pathlib import Path
import pytest
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "master_data/scripts"))
import check_master as cm # noqa: E402
import helper_855_engine as h # noqa: E402
COEF = "계수_건설품셈_01장_적용기준.json"
LOGIC = "로직_건설품셈_01장_적용기준.json"
JIGE = "GC001140"
BASE = {
"재료종별": "암석",
"재료형상": "화강암",
"회당운반량": 0,
"실작업시간": 0,
"경사각도": 0,
"재료갈래": "석재류",
"운반로": "불량",
"운반회수": 0,
}
@pytest.fixture(scope="module")
def whole():
return cm.master()
def qty(whole, ref, **given) -> Decimal:
line = h.calc(ref, {**BASE, **given} if ref == JIGE else given)["줄"][0]
return line["수량"].quantize(Decimal("0.000001"))
@pytest.mark.parametrize(
"given, want",
[
# 북부청 임도 단산10 야면석소운반 — 엑셀이 1일 운반횟수 42 를 값으로 넣음
({"운반무게": 575, "운반거리": 6, "경사각도": 35, "운반회수": 42}, "0.547619"),
# 동부청 영월 D01466 야면석소운반 — L 20 · V 2,000 · t 2
({"운반무게": 575, "운반거리": 20}, "0.163556"),
# 동부청 영월 D00450 콘크리트소운반 — 단위중량 표 콘크리트 2,300㎏
(
{"운반무게": 0, "재료종별": "콘크리트", "재료형상": "해당 없음", "운반거리": 20},
"0.654222",
),
# 북부청 사방 단산17 떼소운반 — 33㎏ · 운반회수 100
({"운반무게": 33, "운반거리": 20, "운반회수": 100}, "0.013200"),
],
)
def test_재현(whole, given, want):
assert qty(whole, JIGE, **given) == Decimal(want)
def test_북부청_금액(whole):
got = h.calc(JIGE, {**BASE, "운반무게": 575, "운반거리": 6, "운반회수": 42})
line = got["줄"][0]
assert line["이름"] == "보통인부"
if line["단가"] == 172068: # 2026 상반기 건설노임 — 엑셀 94,227.7
assert round(line["금액"], 1) == Decimal("94227.7")
def test_경사_환산_식(whole):
# α 35° = 8 → 환산 48m · V 2,000 · t 2 · T 450 → N 92.21 → 575/25/N
got = h.calc(JIGE, {**BASE, "운반무게": 575, "운반거리": 6, "경사각도": 35})
assert got["값"]["k_환산"] == 8 # 문서 값 칸(기호 이름)
assert got["값"]["T_작업"] == 450
assert got["줄"][0]["수량"].quantize(Decimal("0.000001")) == Decimal("0.249422")
def test_기계설비_벽돌(whole):
given = {
"운반무게": 100,
"재료종별": "암석",
"재료형상": "화강암",
"회당운반량": 0,
"실작업시간": 0,
"운반거리": Decimal("0.1"),
"경사각도": 0,
"도로상태": "보통",
}
# 4인 ÷ 450분 × (60 × 2 × 0.1 / 1.5 + 2)
assert qty(whole, "GC001141", **given) == Decimal("0.088889")
assert qty(whole, "GC001142", 운반="인력", 층수=3) == Decimal("0.74")
assert qty(whole, "GC001142", 운반="리프트", 층수=5) == Decimal("0.31")
def test_check_master():
files, whole = h.master_files([COEF, LOGIC]), cm.master() # 로직 = 문서 줄
own = {k: v for k, v in files.items() if not k.startswith("로직_")} # 문서 줄 = check_docs 몫
found = [x for name, data in own.items() for x in cm.check_form(name, data)]
found += cm.check_body(own) + cm.check_docs(own, whole)
assert found == []
keys = {t["키"] for t in files[COEF]["표"] if t["원문번호"] == "1-2-7"}
assert keys == {f"CC000{n}" for n in range(341, 349)}
assert [r["키"] for r in files[LOGIC]["줄"]][:3] == ["GC001140", "GC001141", "GC001142"]