Files
Aislo/resources/tester/test_472_5_value_owner.py
T
eomsangdonandClaude Opus 5.5 990832d629 refactor(472-5 5-C 값 주인 하나): 종단 편집 · 페이지 설정 = 설계 가게 칸 — ↶ ↷ 뒤 두 보기 · 폼 · 기울기 한도 같은 값(N6 · N7)
- 종단 편집: 모듈 사본 EditState 걷음 — 지금 값 = 가게 alignmentDraft(세션) ?? 새 칸 alignmentSaved(노선별 서버 저장분 · 메모리)
  · ↶ ↷ = 다시 읽기만(resync · 같은 값이면 다시 셈 없음) · [저장] 뒤 ↶ 가 저장 전 서버 값으로 안 돌아감 · 노선 없는 창구는 그 안 메모리
- 페이지 설정: 가게 칸 pageSettings(세션 pagesettings) · ↶ ↷ 훅이 가게로 다시 알림 → 폼(B05) · 기울기 한도 · 시작 측점(종단도 한 벌)이 들음(N6)
- 최소고 강제: 결과 통 사본 칸 profile-enforce-min-cover 지움 — 편집 가드가 페이지 설정(초안 ?? 저장 노선)을 바로 읽음(N7)
- 시험: test_472_5_value_owner(옛 코드 빨강 3) · 헬퍼 271 · 442_2 가게 창구 따라감 · 최소고 가드 글 검사 줄
- 위키 design_page 값 · 조작 · 세션 열쇠 · 규칙 줄

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

59 lines
2.0 KiB
Python

# -*- coding: utf-8 -*-
"""472-5 5-C — 종단 편집 · 페이지 설정 값 주인 = 설계 가게 칸 하나.
옛 흠: 종단 편집은 모듈 사본(EditState)이 지금 값을 쥐어 ↶ 뒤 다른 창구가 옛 값 · [저장] 뒤 ↶ 가 저장 전
서버 값으로 돌아감 · 페이지 설정 ↶ 는 세션 칸만 돌아오고 폼 · 기울기 한도는 안 들음(N6) · 최소고 강제는
결과 통 사본 칸(N7).
"""
from __future__ import annotations
import json
import subprocess
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[2]
HELPER = ROOT / "resources" / "tester" / "helper_472_5_value_owner.cjs"
pytestmark = pytest.mark.skipif(
not (ROOT / "config" / "node_modules" / "typescript").is_dir(),
reason="프론트엔드 의존성 미설치",
)
@pytest.fixture(scope="module")
def got() -> dict:
run = subprocess.run(
["node", str(HELPER)], capture_output=True, text=True, encoding="utf-8", timeout=120
)
assert run.returncode == 0, run.stderr
return json.loads(run.stdout)
Y = {"station_offsets": {"20.000": 0.2}, "curve_radii": {"40.000": 30}}
X = {"station_offsets": {"20.000": 0.5}, "curve_radii": {"40.000": 30}}
def test_되돌리면_두_창구가_같은_값(got):
assert got["undo"]["a"] == Y
assert got["undo"]["b"] == Y
assert got["undo"]["aDirty"] is True
assert got["undo"]["resync"] is True # 다시 셈
assert got["undo"]["again"] is False # 같은 값 = 다시 셈 예약 없음
def test_저장_뒤_되돌려도_저장한_값(got):
assert got["afterSave"] == {"edits": X, "dirty": False, "canRestore": False}
def test_페이지_설정_되돌리면_가게가_알림(got):
assert got["settingsHeard"][-1] is None # ↶ 로 초안이 빔 → 듣는 쪽이 저장 설정으로 다시 얹음
def test_최소고_강제는_페이지_설정_한_칸(got):
assert got["enforceSaved"] is True
assert got["enforceDraft"] is False
assert got["copyKey"] == "none"