- 지움: M01 LogicLab_Ho · LogicLab_Cover · M02 Sangeun_Cover_Model · Sangeun_Undo · Sangeun_BaseHead · Labor_RowSk - Sangeun_Detail: 숨긴 몸 · 바탕 원값(bare) 셈 · 덮개 고침 · 재료 고름 · 키 글자 약속(SK-000000) 걷음 → 모드 옵션(page · ref · memory) - Sangeun_Tabs: 몸 그릇 · 숨김 걷음 · Sangeun_Cover: 뺀 줄 띠 걷음 · 셈 보기 덧칸 끔(머리 띠는 안 씀) · 머리 띠 타입만 둠(856-2 에서 파일째) - 일위대가 줄 모달: 로직 줄 · 셈 주입 줄 = 안내 한 줄(856-3 까지) · 상세 · [적용] 걷음 · 줄 패치 칸 · 타입 걷음(저장본 0) - M01 LogicLab_Detail: M02 몸 칸 걷음(M01 보기 그대로) · 지운 파일만 쓰던 글 키 16 · CSS 규칙 걷음 - 시험: 지운 몸만 붙든 시험 지움(717_3 · 722 · 748_0 · helper 728_2 · 748_0) · 섞인 파일은 몸 꼴 · 글 대조 함수 · 줄만 지움(서버 셈 시험 남김) · 856-0 단언 뒤집음 - 수치: 열 때 /sangeun/calc 2 → 1 · 숨은 몸 DOM 2 → 0 · 화면 파일 줄 −1.9 천 안팎 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
89 lines
3.9 KiB
Python
89 lines
3.9 KiB
Python
# ruff: noqa: E501
|
|
"""799-2 옛 탭 넷 걷음 지킴 — 시트 · 인력/재료/경비 · 시험 계산 · 텍스트 수식 (M01 로직 상세 · M02 단가산출 상세).
|
|
|
|
- 걷은 파일은 없고 어디서도 안 부름 · 보기 = 수식 · 단가산출 상세 둘 · 기본정보는 맨 위
|
|
- 셈 구동은 화면 칸 없이 `_Logic_Drive.ts`(서버 셈) — M01 상세는 구동만 · 시험 계산 칸(`Logic_Calc`)은 로직 복사 화면 몫
|
|
"""
|
|
|
|
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
|
|
|
|
|
|
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
|