- ② 카드 안 노면공 포장층 누름 = 목록 고름과 같은 길(범위 카드 전부 · 포장층 강조) — 카드 고름보다 먼저 가로챔 - ③ 카드 하나 누름 = 연 노면공 · 범위 강조 풂 · 그 카드 하나(165-1 노면공 지킴 · 167-3 재누름 그대로 없앰) - 카드 고름 세션 = 그 측점(구조물 id 는 목록 · 알약 · 넘김이 고른 것만) - 종단: 구조물 넘김이면 측점선 · 3D 띠 안 켬 - 새 시험 test_189_1_pave_pick · test_165 · test_188_1 기대값 41번 규칙으로 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STqEqztUthVFBmEP18wBSz
121 lines
4.2 KiB
Python
121 lines
4.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""165 B06 노면공 고름 일관성 — 조사 K 재현 차례 6단계.
|
|
|
|
못박는 것(단계마다 폼 · 알약 · 포장층 · 고른 카드 · 세션 sid 가 같은 것을 가리킴)
|
|
1. 목록 노면공 = 포장층 · 알약 · 폼 · sid 모두 노면공 · 카드는 안 고름(스크롤만 · 177-4 · 기준점이 범위 경계여도 범위 밖 카드로 안 감).
|
|
2. 범위 안 빈 카드 = 카드 하나 고름 · 노면공 풂 · 세션 = 그 측점(189-1 이 165-1 · 167-3 을 바꿈).
|
|
3. 고른 카드의 벽 = 관 폼 + 관 알약(알약이 꺼진 채 폼만 남지 않음 · 165-2) · 포장층 풂.
|
|
4. 알약 다시 = 1 과 같음. 관 자리 카드 = 관 · 범위 밖 카드 = 모두 풂(지금처럼).
|
|
5. B05 알약 → B06 복귀 = 1 과 같음 · 넘김 카드에서 안 튐.
|
|
6. 겹친 노면공 둘 = 고른 층만 · 범위 안 카드 누름 = 카드 하나(189-1).
|
|
|
|
Node 헬퍼 `helper_165_pavement_flow.cjs` 가 진짜 SPN 에 폼 · 카드 · 알약 흉내를 붙여 돌림. 화면은 사용자 확인.
|
|
"""
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
|
|
import pytest
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
ROOT = os.path.abspath(os.path.join(HERE, "..", ".."))
|
|
|
|
|
|
def _read(*parts: str) -> str:
|
|
with open(os.path.join(ROOT, *parts), encoding="utf-8") as handle:
|
|
return handle.read()
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def out():
|
|
proc = subprocess.run(
|
|
["node", os.path.join(HERE, "helper_165_pavement_flow.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=60,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
return json.loads(proc.stdout)
|
|
|
|
|
|
def _pave(card, layer="pave", cards=12):
|
|
# 노면공 고름 = 카드 하나 안 고름 · 종단 측점선 없음(189-1)
|
|
return {
|
|
"form": layer,
|
|
"pill": layer,
|
|
"paveLayer": layer,
|
|
"paveCards": cards,
|
|
"card": card,
|
|
"sid": layer,
|
|
"line": None,
|
|
}
|
|
|
|
|
|
def _card(at):
|
|
# 카드 하나 고름 = 그 측점 기준 · 노면공 · 범위 강조 풂 · 세션 sid 없음(189-1)
|
|
line = None if at is None else f"s{at}"
|
|
return {
|
|
"form": None,
|
|
"pill": None,
|
|
"paveLayer": None,
|
|
"paveCards": 0,
|
|
"card": at,
|
|
"sid": None,
|
|
"line": line,
|
|
}
|
|
|
|
|
|
PIPE = {
|
|
"form": "pipe-80.17",
|
|
"pill": "pipe-80.17",
|
|
"paveLayer": None,
|
|
"paveCards": 0,
|
|
"line": "s80.17",
|
|
}
|
|
|
|
|
|
def test_1_목록_노면공(out):
|
|
assert out["step1"] == _pave(None) # 카드 하나 안 고름(177-4)
|
|
assert out["reveal1"] == "s40" # 기준점 30 = 범위 경계 → 범위 안 첫 카드(20 아님)
|
|
|
|
|
|
def test_2_범위_안_빈_카드는_카드_하나(out):
|
|
assert out["step2first"] == _card(40)
|
|
assert out["step2re"] == _card(None) # 같은 카드 재누름 = 풂(189-1)
|
|
assert out["step2"] == _card(140)
|
|
assert out["step2b"] == _card(100)
|
|
|
|
|
|
def test_3_벽은_관_폼과_관_알약_함께(out):
|
|
assert out["step3"] == {**PIPE, "card": 100, "sid": None}
|
|
|
|
|
|
def test_4_알약_다시_관_카드_범위_밖(out):
|
|
assert out["step4"] == _pave(None)
|
|
assert out["pipeCard"] == {**PIPE, "card": 80, "sid": None}
|
|
assert out["outside"] == _card(280)
|
|
assert out["outsideRe"]["card"] is None
|
|
|
|
|
|
def test_5_B05_복귀(out):
|
|
assert out["step5"] == _pave(None)
|
|
|
|
|
|
def test_6_겹친_노면공(out):
|
|
assert out["step6"] == _pave(None, "pave2", 6)
|
|
assert out["step6b"] == _card(160)
|
|
|
|
|
|
def test_배선():
|
|
panel = _read("B06_Section", "B06_Section_UI_Page_Structures_Panel.ts")
|
|
assert "deps.focusChainage(focusOf(structure), pave);" in panel
|
|
assert "openId" not in panel # 범위 안 빈 카드 = 연 노면공 지킴(165-1) 없앰 · 189-1
|
|
# 관 알약은 폼 뒤(폼이 연 구조물을 닫으며 알약을 끔)
|
|
at = panel.index("section.selectPipeByChainage(hit.pipeChainageM);")
|
|
assert at < panel.index("deps.markStructure?.(`pipe-${hit.pipeChainageM.toFixed(2)}`);", at)
|
|
view = _read("B06_Section", "B06_Section_UI_Section_View.ts")
|
|
assert "spanMarkId = span || isPavement(structureId) ? structureId : null;" in view
|
|
assert "held" not in view # 범위 카드 재누름 = 그대로(167-3) 없앰 · 189-1
|