Files
Aislo/resources/tester/test_290_1_project_purge.py
T
eomsangdonandClaude Opus 5.5 10894b5b34 feat(520-3): 페이지 넘김 공용 moveStage — 잠금 + 진행 원(n/N 단계 이름 · 지난 초) · B07 · B08 · B09 · 미리보기 [<] [>] · 단계 판 누름을 한 길로
- ui_template setLoadingOverlayProgress(ratio, label) — 잠금판 스피너 자리에 진행 원 · 참조가 모두 풀리면 함께 걷힘
- b_workflow_nav moveStage(projectId, 주소 또는 이동 함수, steps) — 단계 { 이름 · 실행 · 선택 서버 진행 묻기 } · 거짓 · 던짐 = 잠금 풀고 머묾(던짐은 까닭 토스트) · 넘기는 중 다시 누름 무시
- goToWorkflowStage 가 Promise 를 돌려줌 — 잠금이 이동 뒤에 풀림
- 낡은 시험 고침 — 298-2 · 481-2 가짜 의존에 moveStage · 290-1 · 280-5 글 약속을 새 길로 · 520-3 시험 새로

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 07:59:58 +09:00

65 lines
2.5 KiB
Python

"""290-1 다른 프로젝트 열면 그 밖 프로젝트 캐시 지움(요구 183-1).
- 들어갈 때(공용 `goToWorkflowStage`) 다른 프로젝트 세션 칸(초안 · 결과 · 옛 키 · 페이지 칸) · 3D 보관함 지움
- 다른 프로젝트에 저장 안 한 고침이 있으면 확인창(지우고 열기 / 남기기) · 남기기 = 그 초안만 둠
- 같은 프로젝트로 다시 들어오면 아무것도 안 지움 · 지금 프로젝트 · 계정 취향(pref) 그대로
`helper_290_1_project_purge.cjs` 가 진짜 TS 를 가짜 저장소 위에서 돌림.
"""
import json
import os
import subprocess
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[2]
HERE = os.path.dirname(os.path.abspath(__file__))
A, B, C = "aaaa1111", "bbbb2222", "cccc3333"
MINE = [f"aislo:draft:structures:{B}", f"aislo:result:section-detail:{B}:7"]
UNRELATED = ["aislo.otp-pending", "aislo:entered-project"]
@pytest.fixture(scope="module")
def out():
proc = subprocess.run(
["node", os.path.join(HERE, "helper_290_1_project_purge.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_지우고_열기_다른_프로젝트_모두_지움(out):
assert out["drop"]["keys"] == sorted(MINE + UNRELATED)
assert out["drop"]["purged"] == [B] # 3D 보관함도
assert out["drop"]["asked"] == [
[f"「이름-{A}」에 저장 안 한 고침이 있음 — 지우고 열기 / 남기기", "지우고 열기", "남기기"]
]
def test_남기기_그_프로젝트_초안만_둠(out):
kept = [f"aislo:draft:crossw:{A}:12", f"aislo:draft:structures:{A}", f"b06:culvertopt:{A}:12"]
assert out["keep"]["keys"] == sorted(MINE + UNRELATED + kept)
assert out["keep"]["asked"] == 1
def test_같은_프로젝트_다시_들어오면_안_지움(out):
assert out["same"]["asked"] == 0 and out["same"]["purged"] == 0
assert len(out["same"]["keys"]) == 11
def test_빈_초안은_고침_아님_취향은_둠(out):
assert out["plan"] == [A] # C 의 빈 초안({})은 묻지 않음
assert out["pref"] == "{}"
def test_공용_이동_한_곳에서_부름():
nav = (ROOT / "A00_Common/b_workflow_nav.ts").read_text(encoding="utf-8")
assert "return enterProject(" in nav and "./b_project_switch" in nav
ui = (ROOT / "ui_template/ui_template_elements.ts").read_text(encoding="utf-8")
assert 'cancelLabel = "취소"' in ui and "label: cancelLabel" in ui