- M01 단가산출 기초 · M02 단가산출 상세 보기 = 수식(줄 쌓기 · 기본) · 단가산출 상세 둘 - 줄 쌓기에 M02 사본 [단가 갱신] · [재생성](미리 셈 → 알림 → 저장 · 고침 있으면 막음) · 판 바뀜(409) 문서 그대로면 새 판으로 다시 저장 옮김 - 옛 수식 문서 화면 걷음(formula_doc_screen · defs · edit · lines · math · math_model · rows · sub · formula_doc.css) · 이미 안 부르던 796-2 수식 나무 화면(LogicLab_Equation · Defs · Var · css · M01_Logic_Equation_Model · sheet_formula_cell · ui_template_equation_defs · edit) 걷음 — 18 파일 4,860 줄 - formula_doc_render = 줄 쌓기가 쓰는 reach 만 · 옵션 가로 CSS 는 line_stack.css 로 - 남김 = 계산기 common_util_formula_doc* · 서버 길 · 옵션 · 사본 표지 · 합계 상자 · KaTeX · 시험 페이지 tools/line-stack-test - 시험: test_796_2 지움(걷은 화면 원본 검사뿐) · 799_1 · 800_2 걷은 화면 줄만 뺌 · 799_2 · 802_4b2 · 804_2 보기 · 화면 파일 대상 바꿈 · test_804_6 새로(걷은 파일 · 부르는 곳 없음 · 첫 탭 · 사본 할일) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
92 lines
4.1 KiB
Python
92 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_보기는_수식_단가산출상세_둘():
|
|
m01 = _text(M01 / "M01_MasterData_UI_LogicLab_View.ts")
|
|
m02 = _text(M02 / "M02_MasterTemplete_Sangeun_Tabs.ts")
|
|
for src in (m01, m02):
|
|
assert re.findall(r'\{ value: "(\w+)", label: ', src) == ["stack", "ho"] # 804-6
|
|
assert 'export type LabView = "stack" | "ho";' in m01
|
|
css = _text(M01 / "M01_MasterData_UI_LogicLab_Style.css")
|
|
assert '[data-view="ho"] [data-block]:not([data-block="ho"])' in css
|
|
assert 'data-view="sheet"' not in css and 'data-view="calc"' not in css
|
|
|
|
|
|
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 "export function createDrive(" in drive
|
|
lab = _text(M01 / "M01_MasterData_UI_LogicLab.ts")
|
|
assert "createDrive()" in lab and "buildCalc" not in lab and "data-calc-run" not in lab
|
|
assert "rerun: () => void drive.run()," in lab
|
|
detail = _text(M01 / "M01_MasterData_UI_LogicLab_Detail.ts")
|
|
assert "calcHost" not in detail and "data-calc-run" not in detail and "ctx.rerun?.()" 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
|