지움
- flushDesignStore(design_store · 부름 0) — 시험 344-4 의 flush 대조 한 줄도
- b_page_state 옛 세션 열쇠 옮김(legacy · migrate) · b_project_switch 옛 키 머리
— 옛 열쇠는 세션 저장소(탭 닫으면 사라짐) · 지금 코드가 안 씀 · storage · DB 에 없음
· 시험 290-1 · 401 · 384-1 의 옛 키 줄 뺌
- 시험만 부르던 TS — planFootprint(346-2 거울은 footprintRecord + slopePieces 로 그대로)
· shiftSegment · shiftMovingPoints(쉬프트 단추는 09-02 지움 · min_cover_guard 쉬프트 시험 뺌)
· dropStationsNear(test_b05_station_merge.mjs 지움) · createIrregularStationsSection(부름 0)
· generalStations(234-1 은 기본 맞춤 값으로 같은 것 잼) · sameSummaryItem
- test_b05_b06_save_roundtrip + helper_b05_save_payload 둘 — 프로젝트 936be972 storage 없어 늘 skip
· 같은 저장 왕복은 test_472_6_design_save(창구 원자성) · test_449_save_pipes(관 PUT)
· test_238_1_save_keeps_structure_stations(구조물 측점)가 잼
남김
- migrateLegacyStations — 부르는 곳 있음(design_view_profile_sections) · storage 에 비정규 측점 남음
- common_util_excavation 셋 — 지금은 운영이 부름(design_calc_node)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
70 lines
2.6 KiB
Python
70 lines
2.6 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}",
|
|
]
|
|
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"]) == 10
|
|
|
|
|
|
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_modal.ts").read_text(
|
|
encoding="utf-8"
|
|
) # 확인창 = 부품(552-3)
|
|
assert 'cancelLabel = "취소"' in ui and "okLabel: confirmLabel, cancelLabel" in ui
|