"""804-6(요구 686-1) — 옛 수식 문서 탭 걷음 · 줄 쌓기 = 첫 「수식」 탭 지킴. ① 걷은 파일 없고 부르는 곳 없음 ② M01 · M02 보기 = 수식(줄 쌓기) · 단가산출 상세 ③ 줄 쌓기가 사본 [단가 갱신] · [재생성] · 판 바뀜 다시 저장을 이어 받음. """ from __future__ import annotations import subprocess from pathlib import Path ROOT = Path(__file__).resolve().parents[2] GONE = [ "A00_Common/formula_doc_screen.ts", "A00_Common/formula_doc_defs.ts", "A00_Common/formula_doc_edit.ts", "A00_Common/formula_doc_lines.ts", "A00_Common/formula_doc_math.ts", "A00_Common/formula_doc_math_model.ts", "A00_Common/formula_doc_rows.ts", "A00_Common/formula_doc_sub.ts", "A00_Common/formula_doc.css", "A00_Common/sheet_formula_cell.ts", "M01_MasterData/M01_MasterData_UI_LogicLab_Equation.ts", "M01_MasterData/M01_MasterData_UI_LogicLab_Equation.css", "M01_MasterData/M01_MasterData_UI_LogicLab_EquationDefs.ts", "M01_MasterData/M01_MasterData_UI_LogicLab_EquationVar.ts", "M01_MasterData/logic/M01_Logic_Equation_Model.ts", "ui_template/ui_template_equation_defs.ts", "ui_template/ui_template_equation_edit.ts", ] def _text(rel: str) -> str: return (ROOT / rel).read_text(encoding="utf-8") def test_걷은_파일_없고_부르는_곳_없음(): assert not [g for g in GONE if (ROOT / g).exists()] names = [Path(g).name.rsplit(".", 1)[0] for g in GONE] out = subprocess.run( ["git", "-c", "core.quotepath=off", "ls-files", "*.ts", "*.css", "*.html"], cwd=ROOT, capture_output=True, text=True, encoding="utf-8", check=True, ).stdout # fmt: skip for rel in out.splitlines(): if rel.startswith(("docs/", "tmp/")) or not (ROOT / rel).exists(): continue text = (ROOT / rel).read_text(encoding="utf-8", errors="ignore") for n in names: assert f'/{n}"' not in text and f"{n}.css" not in text, (rel, n) def test_보기_수식은_줄쌓기_첫탭(): for rel in ( "M01_MasterData/M01_MasterData_UI_LogicLab_View.ts", "M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts", ): src = _text(rel) assert '{ value: "stack", label: tl("View_Equation") },' in src, rel assert 'value: "stack",\n' in src and '"equation"' not in src, rel lab = _text("M01_MasterData/M01_MasterData_UI_LogicLab.ts") assert "createStackScreen({" in lab and "createDocScreen" not in lab def test_줄쌓기가_사본_할일_이어받음(): src = _text("A00_Common/line_stack_screen.ts") assert "copyTools(true, (job) => void runJob(job))" in src assert 'call("/preview", { 할일: job })' in src assert "e.status !== 409" in src and "#끊음" not in src assert len(src.splitlines()) <= 700