- A00_Common/design/design_leave.ts — 고침 칸(초안 통 − 고름 · 관 id 장부 · 종류 캐시 · 구조물 넘김 · 표준 횡단면 · b08 · b09) 지문 · 모든 노선 - 횡단 초안은 [저장] 뒤에도 남음 — 저장 · 확정 끝 깨끗한 표(markDesignClean)와 다를 때만 물음 · [초기화]는 초안을 다 지움 - B05 ↔ B06 이동은 안 묻고 다시 걺 · [버리고 넘어감] = 고침 칸만 지움 · 저장 실패 = 머묾 - design_page 한 줄(걺) · design_shared 한 줄(저장 끝 표) · 문구 B05_Design_Leave · b07-extent 묶음 다시 지음 - 시험 test_346_4_design_leave.py Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QyNXY2TUKXCFMwAca2APG
58 lines
2.0 KiB
Python
58 lines
2.0 KiB
Python
"""346-4 떠남 확인 — B05 · B06 저장 안 한 조작이 있으면 탭 닫기 · 다른 페이지 때 물음.
|
|
|
|
./venv/Scripts/python.exe -m pytest resources/tester/test_346_4_design_leave.py -q
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
HELPER = Path(__file__).resolve().parent / "helper_346_4_design_leave.cjs"
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def out() -> dict:
|
|
run = subprocess.run( # noqa: S603 — 고정 실행 파일
|
|
["node", str(HELPER)], capture_output=True, text=True, encoding="utf-8"
|
|
)
|
|
assert run.returncode == 0, run.stderr
|
|
return json.loads(run.stdout)
|
|
|
|
|
|
def test_고침_아닌_칸은_안_물음(out) -> None:
|
|
assert out["emptyDirty"] is False
|
|
assert out["nonEditDirty"] is False and out["nonEditUnload"] is False
|
|
assert out["nonEditLeave"] is True and out["askedNonEdit"] == 0
|
|
|
|
|
|
def test_횡단_초안이면_물음(out) -> None:
|
|
assert out["editDirty"] is True and out["editUnload"] is True
|
|
assert out["cancelLeave"] is False
|
|
|
|
|
|
def test_B05_B06_사이는_안_묻고_다시_걺(out) -> None:
|
|
assert out["samePage"] is True and out["reArmed"] is True and out["askedSamePage"] == 0
|
|
|
|
|
|
def test_저장_실패는_머묾_성공_뒤엔_안_물음(out) -> None:
|
|
assert out["saveFailLeave"] is False
|
|
assert out["saveLeave"] is True and out["saves"] == 2
|
|
assert out["afterSaveDirty"] is False and out["afterSaveUnload"] is False
|
|
assert out["afterSaveLeave"] is True and out["askedAfterSave"] == 0
|
|
|
|
|
|
def test_버리고_넘어감은_고침_칸만_지움(out) -> None:
|
|
assert out["reEditDirty"] is True and out["discardLeave"] is True
|
|
left = out["left"]
|
|
assert left["crossdesign"] is None and left["alignment"] is None and left["routeDraft"] is None
|
|
assert left["selection"] and left["stdCross"] and left["b08"]
|
|
assert out["afterDiscardDirty"] is False
|
|
|
|
|
|
def test_페이지가_빠지면_안_물음(out) -> None:
|
|
assert out["goneLeave"] is True and out["goneUnload"] is False and out["askedGone"] == 0
|