feat(812-4): 연결 찾기 율 값 = 참고 — 율 줄 판정 = 구조(대상 · 비목)만 · 율 값 % 다름 = 확정 + 참고(바꾸면 우리 값) · 율 대상 · 비목 다름 = 다른 항 그대로
- M02_Doc_Match_Note.rate_pairs → (다른 항, 참고) · 「율 값」 다른 항 폐지(EXPLAINED 에서도 뺌) · 띠 참고 요약에 「율 값 다름 N 줄」 - 시험: test_812_2 율 값 = 참고로 고침 · test_812_4 새(리퍼 105 · 275 확정 + 참고 · 율 대상 다름 = 다른 항 · 바꾸기 뒤 M01 율 · 되돌리기) - 전수 2,220: 확정 152 → 163 · 근접 588 → 577 · 없음 1,480 · 확정 다시 셈 다름 0
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
(a) 단가만 다름 = 확정 + 참고 「단가 차이」(원파일 기계경비 묶음 ↔ 우리 기계 = 이름 종류 같을 때) ·
|
||||
끝수만 다름 = 확정 + 참고 「끝수」
|
||||
(b) 로직 차이 = 다른 항 — 율 비율 다름(「율 값」) · 기계 규격 · 노임 종류(「자원」) · 산출 단가 · 비목
|
||||
(b) 로직 차이 = 다른 항 — 율 대상 · 기계 규격 · 노임 종류(「자원」) · 산출 단가 · 비목
|
||||
(c) 율 = 비율 — 거창 합판거푸집(블록 41): 가져온 「주자재소계 × 9 %」 = M01 소모자재 9 % 짝 · 율_2 1 % 재료비 ↔
|
||||
공구손료 1 % 경비 = 「비목」 · 대전 합판 단가 = 참고
|
||||
(d) 요구 704 배수관부설 D=800 ↔ GF000179 = 여전히 근접(단위 환산 × 6 · 기계 규격 · 율 줄)
|
||||
@@ -81,9 +81,11 @@ def test_rounding_only_is_sure_with_note() -> None:
|
||||
|
||||
|
||||
# ── (b) 로직 차이 = 다른 항 ──────────────────────────────────────────────
|
||||
def test_rate_ratio_differs_blocks() -> None:
|
||||
def test_rate_value_is_note_structure_is_logic() -> None:
|
||||
res = dm.verdict([*A, _rate("공구손료", "0.02")], [*A, _rate("공구손료", "0.03")], TOT, TOT)
|
||||
assert [d["항"] for d in res["다른"]] == ["율 값"] and res["판정"] == dm.NEAR
|
||||
assert not res["다른"] and res["판정"] == dm.SURE
|
||||
assert [d["항"] for d in res["참고"]] == ["율 값"] # 율 값(%) 다름 = 참고(812-4) · 로직 같음
|
||||
assert "2 % ↔" in res["참고"][0]["글"] and "3 %" in res["참고"][0]["글"]
|
||||
same = dm.verdict([*A, _rate("율", "0.02")], [*A, _rate("공구손료", "0.02")], TOT, TOT)
|
||||
assert same["판정"] == dm.SURE # 율 · 대상 · 비목 같음 = 이름 달라도 같은 율 줄
|
||||
tgt = dm.verdict(
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
# ruff: noqa: F811 — 임시 층 fixture(world)를 test_m02_labor_ref 에서 받아 씀
|
||||
"""812-4 지킴 — 율 값(%) 다름 = 참고(값은 M01 값으로 업데이트됨) · 율 대상 · 비목 다름 = 다른 항(로직).
|
||||
|
||||
(a) 원파일 main 블록 105(터파기 · 리퍼 2.42 % ↔ 우리 유압식 리퍼 2 %) · 275(절토면고르기 리퍼) =
|
||||
확정 + 참고 「율 값」 (다른 항 0) · 글에 「바꾸면 우리 값」
|
||||
(b) 확정 + 참고 블록 [바꾸기] → 금액 = M01 사본 셈(율도 M01 값) · [되돌리기] → 원래 금액 · M01 문서 파일 그대로
|
||||
(c) 대상이 다른 율(교량받침 1.14 % ↔ 공구손료 3 % 노임 노무비) = 여전히 다른 항 「율 대상」
|
||||
원파일 없으면 skip(다른 PC) — 합성 줄 시험은 test_812_2.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from decimal import Decimal as D
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
ROOT = HERE.parents[1]
|
||||
for p in (ROOT, HERE):
|
||||
if str(p) not in sys.path:
|
||||
sys.path.insert(0, str(p))
|
||||
|
||||
import test_810_2_native_doc as t2 # noqa: E402
|
||||
import test_810_4_match as t4 # noqa: E402
|
||||
|
||||
from M02_MasterTemplete import M02_Doc_Match as dm # noqa: E402
|
||||
from M02_MasterTemplete import M02_Doc_MatchSk as msk # noqa: E402
|
||||
from M02_MasterTemplete import M02_MasterTemplete_Store as store # noqa: E402
|
||||
from M02_MasterTemplete import M02_Sangeun_FromHopyo as fh # noqa: E402
|
||||
from resources.tester.test_m02_labor_ref import world # noqa: E402, F401 — 같은 임시 층
|
||||
|
||||
|
||||
def _judge(no: int, tag: str = "main") -> dict:
|
||||
whole, _, index, links = t4.ctx()
|
||||
try:
|
||||
out = t2.fn.emit(t2.native("EST", tag), no)
|
||||
doc = t4.dim.derive(t2.sk_of(out), None, t2.whole())
|
||||
except FileNotFoundError:
|
||||
pytest.skip("원파일 없음")
|
||||
return dm.match(doc, t4.dim.Links(whole, "우리"), index, links)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(("no", "key"), [(105, "GC000089"), (275, "GC000111")])
|
||||
def test_rate_value_only_is_sure_with_note(no: int, key: str) -> None:
|
||||
got = _judge(no)
|
||||
assert got["판정"] == dm.SURE and got["키"] == key and not got["다른"]
|
||||
rate = [d for d in got["참고"] if d["항"] == "율 값"]
|
||||
assert len(rate) == 1 and "바꾸면 우리 값" in rate[0]["글"] and "2 %" in rate[0]["글"]
|
||||
|
||||
|
||||
def test_rate_target_differs_stays_logic() -> None:
|
||||
got = _judge(1533) # 교량받침설치 — 율 대상 기계 · 노임 ↔ 노임
|
||||
assert "율 대상" in {d["항"] for d in got["다른"]} and got["판정"] != dm.SURE
|
||||
|
||||
|
||||
def test_swap_rate_note_block_uses_m01_rate(world) -> None:
|
||||
folder = world["personal"]
|
||||
est = t2._file(t2.EST["main"])
|
||||
before = {p.name: p.read_bytes() for p in dm.ml.FOLDER.glob("수식_*.json")}
|
||||
with store.at(folder):
|
||||
hp = fh.upload_native(folder, est.name, est.read_bytes(), t2.WHO)["키"]
|
||||
name = fh.make(folder, hp, 105)["이름"]
|
||||
old = store.read("sangeun", name)
|
||||
money0 = t4._money(name)
|
||||
found = msk.find(name, old["판"])
|
||||
meta = found[dm.KEY]
|
||||
assert meta["판정"] == dm.SURE and any(d["항"] == "율 값" for d in meta["참고"])
|
||||
assert t4._money(name) == money0 # 찾기 = 기록만
|
||||
msk.swap(name, found["판"])
|
||||
doc = store.read("sangeun", name)["문서"]
|
||||
want = dm._calc(dm.ml.load_all()[meta["키"]], dm.ml.Links(t2.whole()), dict(meta["옵션"]))
|
||||
assert t4._money(name) == [want[k] for k in t4.COSTS] # 율도 M01 값
|
||||
assert doc["바탕"] == {"로직": meta["키"]} and sum(t4._money(name)) != sum(money0)
|
||||
msk.back(name, store.read("sangeun", name)["판"])
|
||||
assert t4._money(name) == money0 # 되돌리기 = 원래 금액
|
||||
assert D(sum(money0)) > 0
|
||||
assert before == {p.name: p.read_bytes() for p in dm.ml.FOLDER.glob("수식_*.json")}
|
||||
Reference in New Issue
Block a user