Files
Aislo/resources/tester/test_723_labor_table.py
eomsangdonandClaude Opus 5.5 4673fd89ab feat(811-1): 일위대가 단가산출 줄 = SK 참조 한 행 · M01 기초 = 그 층 SK 사본 · 옮기기 도구
- 저장 · 읽기 · 복사 때 SC 안 SK 참조 줄 안 펼침(Library_Flat flat_doc sk=False) · 셈 = SK 1 단위 × 수량
- [로직 추가] M01 기초 = 그 층 SK 사본 참조(POST sangeun/from-logic · 같은 내용 물음) · 다른 층 SK = 이 층 사본 뒤 참조(Labor_SkPick)
- 프로젝트 · 셈 주입 = 옛 로직 줄 그대로
- 옮기기 M02_Labor_SkRow — 층 SC · 구조물 조합 로직 줄 → SK + 참조 한 행 · 면적 칸 잇기 옮김 · 줄마다 금액 같을 때만 · 보기 = 임시 사본
- 낡은 시험 고침: test_740_1 넷(SC 안 SK 줄 펼침 단언 → 참조 한 행) · test_723 AlsoSk(808-1 에서 걷힌 단추 단언)
- 새 시험 test_811_1_labor_ref

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 20:48:27 +09:00

62 lines
2.9 KiB
Python

"""PLAN 723 — M02 일위대가(사전조합) 일위대가표만 · 줄 모달(내역 16 · 17).
723-1 서버 — 구조물 조합 알약에 안 줄 알약
(안 줄 수량 저장은 742-1 이 되살림 · `test_742_1_sc_qty_saved`).
723-2 · 723-3 화면 — 서고 상세 = `Labor_Table`(우클릭) · 줄 모달 = 717-2b 상세 줄 모드.
"""
import os
from M02_MasterTemplete import M02_Labor_Doc as labor
from M02_MasterTemplete import M02_Labor_Ref as refs
from M02_MasterTemplete import M02_MasterTemplete_Store as store
from resources.tester.test_m02_labor_ref import world # noqa: F401 — 임시 층 fixture
SRC = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "M02_MasterTemplete")
SYS = {"층": "system", "주인": None}
STONE = "GF000219" # 원/㎡
RATE = {"이름": "공구손료", "단위": "%", "단가": {"노무비": 0, "재료비": 0, "경비": 0}}
def _src(name: str) -> str:
return open(os.path.join(SRC, name), encoding="utf-8").read()
def test_구조물_조합_알약에_안_줄_알약(world): # noqa: F811
with store.at(world["system"]):
key = refs.create(
"precombo", {"이름": "옹벽", "단위": "m", "담은로직": [{"로직": STONE, "별칭": "돌"}]}
)["이름"]
doc = labor.clean({"열": "rv", "담은로직": [{"참조": {**SYS, "키": key}}]})
pills = labor.pills(doc)
rid = refs.ref_id({**SYS, "키": key})
assert [p["키"] for p in pills] == [rid, f"{rid}#0"]
assert pills[1]["이름"] == "옹벽 · 돌" and pills[1]["단위"] == "㎡"
def test_화면_서고_상세는_일위대가표만():
table, detail = (
_src("M02_MasterTemplete_Labor_Table.ts"),
_src("M02_MasterTemplete_Labor_Detail.ts"),
)
assert "return mountLaborTable(host, doc, opt);" in detail # 806-1 — 조합도 같은 부품
assert (
"calc = settle(calc, cur, combo?.given() ?? {});" in table
) # 짝 셈 바로(742-1 수량 = 문서)
assert 'const out: Record<string, unknown> = { ...cur, 종류: "사전조합" };' in table
for label in ('tc("Up")', 'tc("Down")', 't("Alias")', 'tc("Remove")'):
assert label in table # 우클릭 메뉴
assert "fixed: (fx: LaborFixed, name: string)" in table # 721-2 고정 줄 이음
def test_화면_줄_모달은_SK_상세_줄_모드_적용은_덮개와_옵션():
modal, sk = (
_src("M02_MasterTemplete_Labor_RowModal.ts"),
_src("M02_MasterTemplete_Labor_RowSk.ts"),
)
detail = _src("M02_MasterTemplete_Sangeun_Detail.ts")
assert "mountSangeunDetail(box, doc," in sk and "getValues: () => ({ ...values })" in detail
assert "if (got.patch) row.패치 = got.patch;" in modal and "setValues(got.values);" in modal
assert "AlsoSk" not in modal # 808-1 [단가산출로도 저장] 걷음 · 811-1 M01 기초 = SK 사본 참조
assert "openRowSangeun" not in modal # 717-3 두 보기 갈음