- design_facility_lane 새 파일 — 페이지가 세움 · 관 알림 · B06 관 목록 · 구조물 · 종류 · 추가 측점 → 종단도 · 평면 마커 원천 한 곳 - B05 다리 = 목록 · 종류 · 저장만 · B06 종단도 = 읽기만 · 숨었다 보일 때 다시 셈 없음(편집 두 번 옮김 길 걷힘) - 노선 따라감 = 시설 줄 follow(편집 안 옮김) · 사용자 고침만 계획고 편집 옮김 - pipeOptionQueue(메모리) → 세션 칸 pipe-option-queue - 시험 test_271_facility_lane(R3 뒤집기 · B06 먼저 = B05 먼저 · 따라감) · 옮긴 자리 문자열 시험 맞춤 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
73 lines
3.0 KiB
Python
73 lines
3.0 KiB
Python
"""451 B06 세션 캐시 판 · 숨은 종단 보기 관 id 장부(433-16 · 440-3).
|
|
|
|
① 새로고침 · 새 탭 = 세션 상세로 먼저 섬 · 뒤에서 서버 판을 물음 — 다른 탭이 저장해 다르면 서버 값 위에
|
|
이 탭에서 고친 사용자 칸만 · [저장] patch 바탕도 서버 값 · 세션 = 서버 정본 그대로
|
|
② 같은 판 · 서버 실패 = 세션 그대로(갈아끼움 · 알림 없음)
|
|
③ 노선 초안이 옛 상세를 쥔 채 서버 판이 바뀜 — 초안을 버리면 새 판
|
|
④ 숨은 종단 보기도 관 세션 id 장부를 돌림(평면 마커 누름 = 초안 자리 · 장부 = 시설 줄 한 벌 462) · 그리기는 보일 때
|
|
TS 셈은 `helper_451_session_canon.cjs`.
|
|
|
|
./venv/Scripts/python.exe -m pytest resources/tester/test_451_session_canon.py -q
|
|
"""
|
|
|
|
import json
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
HELPER = Path(__file__).with_name("helper_451_session_canon.cjs")
|
|
|
|
pytestmark = pytest.mark.skipif(
|
|
not (ROOT / "config" / "node_modules" / "typescript").is_dir(),
|
|
reason="프론트엔드 의존성 미설치",
|
|
)
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def got() -> dict:
|
|
run = subprocess.run( # noqa: S603 — 고정 실행 파일
|
|
["node", str(HELPER)],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=120,
|
|
)
|
|
assert run.returncode == 0, run.stderr
|
|
return json.loads(run.stdout)
|
|
|
|
|
|
def test_첫_화면은_세션_뒤에서_판_확인(got) -> None:
|
|
assert got["firstFromSession"] is True
|
|
|
|
|
|
def test_판이_다르면_서버_값_위에_내_칸만(got) -> None:
|
|
stale = got["stale"]
|
|
assert stale["swapped"] is True and stale["heard"] == 1
|
|
assert stale["adjust"] == 2 and stale["elevation"] == 101 # 다른 탭이 저장한 값
|
|
assert stale["note"] == "mine" # 이 탭에서 고친 칸
|
|
assert stale["patchAdjust"] == 2 and stale["patchNote"] == "mine" # [저장] 바탕
|
|
assert stale["sessionAdjust"] == 2 and stale["sessionNote"] == "A" # 세션 = 서버 정본
|
|
|
|
|
|
def test_같은_판_실패는_그대로(got) -> None:
|
|
assert got["same"] == {"kept": True, "heard": 0}
|
|
assert got["broken"] is True
|
|
|
|
|
|
def test_초안_hold_는_버리면_새_판(got) -> None:
|
|
hold = got["hold"]
|
|
assert hold["swappedDraft"] is True and hold["draftKept"] == [0, 25, 45, 60]
|
|
assert hold["renewed"] is True and hold["adjust"] == 2 and hold["same"] is True
|
|
|
|
|
|
def test_숨은_종단_보기도_관_id_장부() -> None:
|
|
# 장부 맞춤 = 페이지 시설 줄 한 벌(462) — 관 알림 · 노선 따라감 모두 보기 숨김과 무관
|
|
shared = (ROOT / "A00_Common/design/design_shared.ts").read_text(encoding="utf-8")
|
|
changed = shared[shared.index("onPipesChanged: (pipes) => {") :]
|
|
assert "shared.lane.set({ pipes });" in changed[: changed.index("},")]
|
|
assert "shared.lane.follow();" in shared
|
|
lane = (ROOT / "A00_Common/design/design_facility_lane.ts").read_text(encoding="utf-8")
|
|
assert "placePipeIds(" in lane and "prunePipeIds(" in lane
|