- 지움(git rm) 10 파일 3,374 줄: M02_Hopyo_Finger · Ours · Option · Fit · Combine · Verdict · Line · SkLink · SkPatch · Basis
- Match: 흐름 몫(candidates · name_cands · fix_typo · clause · b_order · _logic_specs · _line_mod · units_of · _state · view · guess · picks · chain) 지움 · 이름 도구 몫 · line_key 남김
- Words: conds · cond_score · close · cosine · jacc 지움 / Shares: sections 지움(trade · eq_key 남김)
- 옮김: Finger.kind_of → Fixed.kind_of · SkLink(sk_line · kept · left · LEFT · WHY) → Sangeun · SkPatch 기계 몫(MACH_IN · MACHINE · SOLO · _mach_logics) → Units.mach_logics
- Sangeun: 옛 /sangeun 몸(build · _sure · Maker.basis · judge · plan · make) 지움 · Kids: first · proposal · order 지움 · Build: build() · unlinked() 지움(모두 고정 Builder · build_all · _order · _origins 남김)
- Router: 옛 길 지움(GET hopyo/{키}/{번} · guess · hopyo-picks · hopyo-build · hopyo-unlinked · hopyo/{키}/sangeun) · GET hopyo/{키} = Judge.view(1차 줄 판정 줄상태 · 만든 · 블록 풀이 셈)
- Marks: 칠 = Judge.judged 만 · Forget: 맞춤 캐시 지움 줄 걷음 · Ledger: Ours.version 판 칸 걷음 · Item: Kids.first 걷음
- Row(덧): 단산 줄 = 장부 짝이 있어도 늘 「2차 필요」(장부 = 1차 후보 힌트만)
시험 정리(까닭 = 지운 길 · 모듈만 시험함):
- 지움 11 파일: test_m02_hopyo_finger · fit · golden · option · ours · basis · seam · flow · draft_calc · test_635 · test_628(지문 · 순위 · 옵션 거꾸로 · 맡은 절 · 옛 확인 흐름)
- 함수 지움: /sangeun · /hopyo-build · /hopyo-unlinked · hopyo-picks · 옛 줄 맞춤 보기를 부르던 것(572 · 718_1 · 729 · 739_1 · 777_1 · 778_5 · 780_1 · labor_national · 705_3 · m02_hopyo_match · 746_1)
- test_621 S2(지문 해시) 지움 · S1 남김 · test_m02_hopyo_build = 장부 길 시험만(PUT 으로 심음)
- 새 길로: 779_2(줄상태 = 1차 판정 · 칠 셈 전 None) · grid · stmate(hopyo-judge 줄 판) · 778_1 · 778_2(Units.mach_logics) · 642_6(Marks 원문) · 642_3 장부 짝 단산 줄 2차 지킴
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
102 lines
3.9 KiB
Python
102 lines
3.9 KiB
Python
"""「전국」 자재 줄(PLAN 361-2 · `M02_MasterTemplete_Labor_National`) — 사전조합 `본뜬.전국자재` 를
|
|
상세 자재목록 아래 보기 전용 표로(있으면 줄 · 없으면 안 보임 · 단추 없음 · 금액 칸 비움 ·
|
|
글 명사형) · 읽기 길(사전조합 GET 의 `layers.read_template`)이 `본뜬.전국자재` 를 그대로 줌 ·
|
|
확인 창 세 칸 = 만들기에 적힐 값(`세칸`).
|
|
층은 임시 폴더.
|
|
"""
|
|
|
|
import json
|
|
import os
|
|
import re
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
# 올리기 길 시험의 `client` 마당을 같이 씀
|
|
# ruff: noqa: F811
|
|
from resources.tester.test_m02_hopyo_excel import URL, _post, client # noqa: F401
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
M02 = Path(HERE).parents[1] / "M02_MasterTemplete"
|
|
REMICON = {
|
|
"이름": "레미콘(전국)-관급",
|
|
"규격": "25-21-120",
|
|
"단위": "㎥",
|
|
"수량": {"손": 2.5},
|
|
"별도계상": "별도계상",
|
|
"자재구분": "관급",
|
|
}
|
|
|
|
|
|
def _rows(origins: list) -> list:
|
|
proc = subprocess.run(
|
|
["node", os.path.join(HERE, "helper_m02_labor_national.cjs")],
|
|
input=json.dumps({"origins": origins}, ensure_ascii=False),
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
check=False,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
return json.loads(proc.stdout)
|
|
|
|
|
|
def test_전국_자재_줄_있는_것_없는_것():
|
|
have, plain, empty, none = _rows(
|
|
[
|
|
{"층": "personal", "주인": "7/42", "키": "HP-000001 제1호표", "전국자재": [REMICON]},
|
|
{"층": "personal", "주인": "7/42", "키": "HP-000001 제3호표"},
|
|
{"층": "personal", "주인": None, "키": "k", "전국자재": []},
|
|
None,
|
|
]
|
|
)
|
|
assert have["title"] == "전국 자재 — 지역은 프로젝트에서 · 금액 없음(보기만)"
|
|
assert have["heads"] == [
|
|
"코드",
|
|
"이름",
|
|
"규격",
|
|
"수량산출",
|
|
"단위",
|
|
"자재구분",
|
|
"별도계상",
|
|
"운반비",
|
|
"반영 금액",
|
|
]
|
|
assert have["rows"] == [
|
|
[
|
|
"전국",
|
|
"레미콘(전국)-관급 지역은 프로젝트에서",
|
|
"25-21-120",
|
|
"2.5",
|
|
"㎥",
|
|
"관급",
|
|
"별도계상",
|
|
"포함", # 빈 칸 = 기본값 글
|
|
"—", # 금액 칸 비움
|
|
]
|
|
]
|
|
assert have["buttons"] == 0 # 고침 · 삭제 없음(보기만)
|
|
assert plain["count"] == empty["count"] == none["count"] == 0 # 없으면 안 보임
|
|
|
|
|
|
def test_소스_보기만_명사형_자리():
|
|
code = (M02 / "M02_MasterTemplete_Labor_National.ts").read_text(encoding="utf-8")
|
|
words = re.findall(r'"([^"]*[가-힣][^"]*)"', code)
|
|
assert words and not [w for w in words if re.search(r"(합니다|해요|한다|하세요)", w)]
|
|
assert "createButton" not in code and "fetch" not in code and "sessionStorage" not in code
|
|
detail = (M02 / "M02_MasterTemplete_Labor_Detail.ts").read_text(encoding="utf-8")
|
|
assert "...nationalRows(cur.본뜬)" in detail and len(detail.splitlines()) <= 700
|
|
api = (M02 / "M02_MasterTemplete_Labor_Api.ts").read_text(encoding="utf-8")
|
|
assert "전국자재?: NationalMat[]" in api
|
|
|
|
|
|
def test_복사_때_실무자료_본뜬과_전국자재_지킴():
|
|
from M02_MasterTemplete import M02_Labor_Ref as refs
|
|
|
|
ref = {"층": "personal", "주인": "7/42", "키": "SC-000001"}
|
|
mine = {"층": "실무자료", "키": "HP-000001 제1호표", "전국자재": [REMICON]}
|
|
kept = refs.origin_mark({"본뜬": mine}, ref)["본뜬"]
|
|
assert kept["키"] == "HP-000001 제1호표" and kept["전국자재"] == [REMICON] # 덮지 않음
|
|
assert kept["복사원본"] == ref # 원본 참조는 다른 칸
|
|
assert refs.origin_mark({"본뜬": None}, ref)["본뜬"] == ref # 보통 문서 = 옛 그대로
|
|
assert refs.origin_mark({"본뜬": {"층": "system", "키": "A"}}, ref)["본뜬"] == ref
|