Files
Aislo/resources/tester/test_799_2_old_tabs_gone.py
T
eomsangdonandClaude Opus 5.5 8c3801e707 refactor(853-1): M01 화면 0 서버 길 15 와 본체 걷음 — 묶음 ② 고친 파일(앞 커밋 654b75b5c 는 지운 파일만 담김)
- 길 지움(화면 TS · 다른 서버 모듈 · 시험 세 곳에서 다시 찾음 · /openapi.json 524 → 509 뜻한 15 만): GET /groups · /sections · /table/options · /logic/combos · POST /logic/new · /logic/edit · /logic/delete · /logic/draft · /logic/sheet · /logic/sheet/check · /logic/equation(+ preview · links · save) · /logic/doc/links
- 본체 지움: M01_MasterData_Sheet.py · Equation.read · preview · save · Store_Make.sections · _counts · table_options · logic_edit · logic_delete · _own_only · logic_draft · Store.groups · Store_Combo.combo_preview · scripts/master_draft.py(지운 /logic/draft 만 부름)
- 남김: Equation.export_row · edit_row · links(M02 Sangeun_Equation 이 부름) · Doc.candidates(M02 /doc/links) · Store_Make._all_sections(M02 Hopyo_Clause) · logic_new(복사 · 수식 저장이 씀) · combos_of_logic(Doc.users) · combo_inputs(알약 규칙 입구 · 시험) · master_combo.run(M02 시험 대조 값) · /alias/suggest(main.py 가 따로 끼움 · 승인 화면과 한 벌)
- 화면 입구 지움: Api_Fetch.fetchGroups · GroupInfo · fetchSubs · Logic_Api.draftLogic + Draft 타입 6
- 시험: test_m01_draft 지움(죽은 해석기 · 길만 봄) · test_794_1 시트 길 시험 지우고 /save 다시 셈 시험만 남김 · test_796_1 수식 길 시험 지움 · test_800_2 는 살아 있는 export_row · edit_row 로 같은 셈 · test_m01_make 는 죽은 길 대신 /save · logic_new 로 같은 결과 · test_m01_combo 미리 보기 시험 지움 · /logic/combos 는 combos_of_logic 로 · test_m01_api · test_802_3 · test_799_2 · test_717_1(+helper) 죽은 길 줄만 고침

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:27:44 +09:00

89 lines
4.0 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 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