chore(853-1): 자료 스크립트 한 번용 25 걷음 — 묶음 ④

- 지움(부르는 곳 = 서로뿐 · 효과는 자료에 반영 · 다시 돌릴 일 없음): _migrate_base · _migrate_keys · _건설기계_* 10 · build_로직_건설품셈_08장_건설기계 · _적용기준_나머지_* 2 · build_로직_건설품셈_01장_적용기준 · build_기계_인력줄_842_3 · build_기계목록_빠진기계_814_1 · build_기계시간당_822_2 · build_기계폴더_826_2 · build_로직_M01보강_794_2a2 · build_로직_기계줄나눔_848_4 · build_로직_잔토처리 · build_로직_재료_고르기 · build_품셈재료_고르기(대상 자료 없음) · master_draft 는 묶음 ② 에서 지움
- 옮김: _migrate_base.dump_master → master_keys.dump_master(글자 그대로) · 갱신 빌더 넷(인력 노임 · 유가전력 · 자재품목 · 환율) import 를 바꿈
- 남김(다시 돌리는 채우기 = 갱신 절차): build_기계_작업량_846_1 · build_단위표기_801_5 · build_변수기호_800_1 · build_변수표_796_3(+ 변수표_796_3.json) · build_용도 · build_재료_검색어
- 시험: test_814_1 기계 목록 시험은 빌더 plan() 대신 수식 문서 기본값만 봄 · test_826_2 는 옮김 빌더 대신 master_machine_files.write 왕복만

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 12:43:03 +09:00
co-authored by Claude Opus 5.5
parent 4060d0ea72
commit 38b172cbcb
32 changed files with 28 additions and 8156 deletions
@@ -12,7 +12,6 @@
from __future__ import annotations
import importlib.util
import json
import sys
from pathlib import Path
@@ -40,7 +39,7 @@ from M02_MasterTemplete import M02_Sangeun_FromHopyo as fh # noqa: E402
from M02_MasterTemplete import M02_Sangeun_Imported as imp # noqa: E402
from resources.tester.test_m02_labor_ref import world # noqa: E402, F401 — 같은 임시 층
SCRIPT = ROOT / "resources/master_data/scripts/build_기계목록_빠진기계_814_1.py"
DOC = ROOT / "resources/master_data/수식문서/수식_건설품셈_08장_건설기계.json"
FAMILY = [f"GC0002{n}" for n in range(67, 77)]
@@ -117,19 +116,8 @@ def test_three_lines_excel_stmate_and_est_combo_group() -> None:
# ── ⑤ 계산식 기계 목록 · 조합 식 ─────────────────────────────────────────
def _build():
spec = importlib.util.spec_from_file_location("build_814_1", SCRIPT)
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
return mod
def test_machine_lists_complete_and_defaults_kept() -> None:
build = _build()
add, skipped = build.plan()
assert add == {} # 빠진 기계 모두 더함(다시 돌려도 같음)
assert all(miss for *_, miss in skipped) # 못 넣음 = 기계표 빈 값(지어 넣지 않음)
docs = json.loads(build.DOC.read_text("utf-8"))["줄"]
def test_machine_lists_defaults_kept() -> None:
docs = json.loads(DOC.read_text("utf-8"))["줄"]
for d in docs:
if d["키"] in FAMILY:
var = next(v for v in d["변수"] if v["열쇠"] == "기계")
+3 -7
View File
@@ -67,14 +67,10 @@ def test_folder_reads_as_one_table(tmp_path: Path) -> None:
assert not (REAL / M).exists() # 같은 내용 두 벌 없음
assert cm.load([M])[M] == data and store.read(M) == (data, version)
assert cm.load()[M] == data # 마스터 전부 읽기에도 같은 이름으로
# 옮기는 빌더 — 한 파일 → 폴더 → 다시 읽어 같음 · 옛 파일 지움 · 두 번 돌려도 같음
import importlib
build = importlib.import_module("build_기계폴더_826_2")
(tmp_path / M).write_text(store.dump(data), encoding="utf-8")
assert build.move(tmp_path) == len(keys) and not (tmp_path / M).exists()
# 쓰고 다시 읽으면 같음 · 같은 것을 또 쓰면 바뀐 파일 0
mmf.write(tmp_path, data)
assert mmf.table(tmp_path) == (data, version) # 같은 글 → 같은 판
assert build.move(tmp_path) == 0 and mmf.write(tmp_path, data) == []
assert mmf.write(tmp_path, data) == []
# ② 고침 · 새 기계 · 지움 · 판 ─────────────────────────────────────────