- 판정 = 자체 로직 편집 · 시험 값 고침 · M02 줄 덮음 · 비목 박스 소계 모두 수식 보기로 됨(살릴 것 없음) - M01 상세: 숨은 단가산출 상세 덩이 · 자체 로직 시트 편집기 · 시험 고침 · 셈 구동(createDrive) · 보기 이름표(View.ts) · data-view CSS 걷음 - M02 불러오기 모달 머리 [항목 추가] · [율 줄 추가] 단추와 그 창(Rate.ts · openSangeunLinePicker) 걷음 - 글 정리 = Info_Own 새 뜻 · 죽은 글 키 · No_Key · 항목 추가 글 걷음 - 낡은 시험 고침 = 722(시험 고침 · 덮기 셈) · 799-2 · 804-2 · 804-6 · 804-7 · 806-1 · 717-2b · 717-4 · 721 · 728-2 — 걷은 것이 없음 확인으로 - 남김 = M02 수식 문서 없는 줄의 단가산출 상세 몸(cover · buildHo) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
90 lines
4.1 KiB
Python
90 lines
4.1 KiB
Python
# ruff: noqa: E501
|
|
"""799-2 옛 탭 넷 걷음 지킴 — 시트 · 인력/재료/경비 · 시험 계산 · 텍스트 수식 (M01 로직 상세 · M02 단가산출 상세).
|
|
|
|
- 걷은 파일은 없고 어디서도 안 부름 · 보기 = 수식 · 단가산출 상세 둘 · 기본정보는 맨 위
|
|
- 셈 구동은 화면 칸 없이 `_Logic_Drive.ts`(서버 셈) — M01 상세는 구동만 · 시험 계산 칸(`Logic_Calc`)은 로직 복사 화면 몫
|
|
- 서버 길은 남김(`/logic/sheet` · 시트 문서 칸 · 수식 검사가 같은 엔진)
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
M01 = ROOT / "M01_MasterData"
|
|
M02 = ROOT / "M02_MasterTemplete"
|
|
GONE = [
|
|
M01 / "M01_MasterData_UI_LogicLab_Sheet.ts",
|
|
M01 / "logic" / "M01_Logic_Sheet_Model.ts",
|
|
M01 / "M01_MasterData_UI_LogicLab_Formula.ts",
|
|
M01 / "M01_MasterData_UI_LogicLab_FormulaTokens.ts",
|
|
M01 / "M01_MasterData_UI_LogicLab_Formula.css",
|
|
M01 / "M01_MasterData_UI_LogicLab_Est.ts",
|
|
M02 / "M02_MasterTemplete_Sangeun_Sheet.ts",
|
|
M02 / "M02_MasterTemplete_Sangeun_SheetEdit.ts",
|
|
M02 / "M02_MasterTemplete_Sangeun_SheetFormula.ts",
|
|
M02 / "M02_MasterTemplete_Sangeun_Sheet.css",
|
|
M02 / "logic" / "M02_Sangeun_Sheet_Model.ts",
|
|
M02 / "logic" / "M02_Sangeun_Const_Model.ts",
|
|
M02 / "logic" / "M02_Sangeun_Formula_Model.ts",
|
|
]
|
|
|
|
|
|
def _text(p: Path) -> str:
|
|
return p.read_text(encoding="utf-8")
|
|
|
|
|
|
def _tracked() -> list[Path]:
|
|
out = subprocess.run(
|
|
["git", "-c", "core.quotepath=off", "ls-files", "*.ts", "*.css"],
|
|
cwd=ROOT, capture_output=True, text=True, encoding="utf-8", check=True,
|
|
).stdout # fmt: skip
|
|
return [ROOT / x for x in out.splitlines() if x and not x.startswith(("docs/", "tmp/"))]
|
|
|
|
|
|
def test_걷은_파일_없고_부르는_곳_없음():
|
|
assert not [p for p in GONE if p.exists()]
|
|
names = [p.name.rsplit(".", 1)[0] for p in GONE]
|
|
for p in _tracked():
|
|
text = _text(p)
|
|
for n in names:
|
|
assert f'/{n}"' not in text and f'./{n}"' not in text and f"{n}.css" not in text, (
|
|
p.name,
|
|
n,
|
|
)
|
|
|
|
|
|
def test_보기는_수식_하나_고르기_없음():
|
|
m02 = _text(M02 / "M02_MasterTemplete_Sangeun_Tabs.ts")
|
|
assert not re.findall(r'\{ value: "(\w+)", label: ', m02) and "createSegment" not in m02
|
|
assert not (M01 / "M01_MasterData_UI_LogicLab_View.ts").exists() # 840-1 보기 이름표 걷음
|
|
lab = _text(M01 / "M01_MasterData_UI_LogicLab.ts")
|
|
assert "createViewPicker" not in lab and "dataset.view" not in lab # 836-3 · 840-1
|
|
css = _text(M01 / "M01_MasterData_UI_LogicLab_Style.css")
|
|
assert "data-view" not in css and "data-block" not in css # 840-1 보기 고르기 규칙 걷음
|
|
|
|
|
|
def test_셈_구동은_화면_없이_상세는_구동만():
|
|
drive = _text(M01 / "M01_MasterData_UI_Logic_Drive.ts")
|
|
assert "document." not in drive and "sessionStorage." not in drive
|
|
assert "export async function driveRun(" in drive and "createDrive" not in drive # 840-1
|
|
lab = _text(M01 / "M01_MasterData_UI_LogicLab.ts")
|
|
assert "createDrive" not in lab and "buildCalc" not in lab and "data-calc-run" not in lab
|
|
detail = _text(M01 / "M01_MasterData_UI_LogicLab_Detail.ts")
|
|
assert "calcHost" not in detail and "data-calc-run" not in detail and "rerun" not in detail
|
|
calc = _text(
|
|
M01 / "M01_MasterData_UI_Logic_Calc.ts"
|
|
) # 로직 복사 화면이 쓰는 시험 계산 칸 — 구동은 공용
|
|
assert "driveRun(ctx)" in calc and "runCalc" not in calc
|
|
m02 = _text(M02 / "M02_MasterTemplete_Sangeun_Detail.ts")
|
|
assert "buildCalc" not in m02 and "calcHost" not in m02 and "createSangeunTabs(editor" in m02
|
|
|
|
|
|
def test_파일_700줄_안():
|
|
for p in (M01 / "M01_MasterData_UI_LogicLab.ts", M01 / "M01_MasterData_UI_LogicLab_Detail.ts",
|
|
M02 / "M02_MasterTemplete_Sangeun_Detail.ts", M02 / "M02_MasterTemplete_Sangeun_Tabs.ts",
|
|
M01 / "M01_MasterData_UI_Logic_Drive.ts"): # fmt: skip
|
|
assert len(_text(p).splitlines()) <= 700, p.name
|