안 준 칸(가로 없음 · 일반 · 세로 없음)의 칸 · 도구줄 · 서식 창 · 편집창 · 영역 표 · 복사 HTML 기본을 가운데로 · 준 칸은 그대로 · 새 시험 추가 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018jonfdxn1Xit9bdkNJpE4G
58 lines
1.9 KiB
Python
58 lines
1.9 KiB
Python
"""맞춤 기본 = 가운데 · 가운데(237-1) — 안 준 칸 · 준 칸 · 도구줄 기본 표시 · 내보내기(복사 HTML).
|
|
|
|
`spreadsheet_align_default_entry.ts` 를 vite `--ssr` 로 번들해 Node 로 돌림. 영역 표 맞춤은
|
|
`test_m02_area_table.py`. 화면(도구줄 · 칸 · 편집창)은 사용자가 확인.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import shutil
|
|
import subprocess
|
|
import tempfile
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
ENTRY = ROOT / "resources" / "tester" / "spreadsheet" / "spreadsheet_align_default_entry.ts"
|
|
VITE = ROOT / "config" / "node_modules" / "vite" / "bin" / "vite.js"
|
|
|
|
|
|
@pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없음")
|
|
def test_맞춤_기본_가운데_237_1():
|
|
with tempfile.TemporaryDirectory(prefix="spreadsheet_align_default_") as outdir:
|
|
entry_rel = "../" + str(ENTRY.relative_to(ROOT)).replace("\\", "/")
|
|
build = subprocess.run(
|
|
[
|
|
"node",
|
|
str(VITE),
|
|
"build",
|
|
"--configLoader",
|
|
"runner",
|
|
"--ssr",
|
|
entry_rel,
|
|
"--outDir",
|
|
outdir,
|
|
],
|
|
cwd=str(ROOT),
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
errors="replace",
|
|
timeout=120,
|
|
)
|
|
assert build.returncode == 0, f"vite ssr 번들 실패:\n{build.stdout}\n{build.stderr}"
|
|
run = subprocess.run(
|
|
["node", str(Path(outdir) / "spreadsheet_align_default_entry.js")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
errors="replace",
|
|
timeout=60,
|
|
)
|
|
assert run.stdout.strip(), run.stderr
|
|
result = json.loads(run.stdout)
|
|
assert result["fail"] == 0, result["failures"]
|
|
assert result["pass"] == 14
|