Files
Aislo/resources/tester/test_152_5_pavement_pick.py
T
eomsangdonandClaude Opus 5.5 4ae7ee25cc feat(B06): 노면공 고름 = 범위 카드 테두리 대신 포장층 강조 · 카드 누름으로 노면공 열기 끊음(152-5)
- 포장층 범위 표식(종류 · 시작 · 끝) · 고른 노면공 층만 is-active(겹침은 하나만)
- 다른 구간형은 --span 그대로
- resolveSelection ③ 덮는 구조물에 거르개 · B06 은 G군 뺌 · 덮는 것 없으면 알약 · 강조 풂

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TNMXVCZXMpHpVvqmFkeChL
2026-10-09 19:13:08 +09:00

71 lines
2.6 KiB
Python

# -*- coding: utf-8 -*-
"""152-5 B06 노면공 강조.
못박는 것
- 포장층마다 범위 표식(종류 · 시작 · 끝) — 고른 노면공의 층만 is-active · 겹친 노면공은 하나만 · 없음 = 모두 풂.
- 노면공(G군)은 범위 카드 테두리(--span) 대신 포장층 · 다른 구간형은 --span 그대로.
- 카드 누름(③ 덮는 구조물)은 노면공을 안 엶 · 목록 · 알약(① id 길)은 그대로 · 덮는 것 없으면 알약 · 강조 풂.
Node 헬퍼 `helper_152_5_pavement_pick.cjs` 가 SVG 그릇 흉내로 돌림. 화면은 사용자 확인.
"""
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_152_5_pavement_pick.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["marks"] == [
{"paveType": "pavement_concrete", "paveStart": "0", "paveEnd": "40"},
{"paveType": "pavement_concrete", "paveStart": "20", "paveEnd": "60"},
]
def test_고른_노면공_층만_강조(out):
assert out["pickSecond"] == [False, True] # 시작 · 끝 거꾸로 와도 같은 범위
assert out["otherType"] == [False, False]
assert out["pickFirst"] == [True, False]
assert out["cleared"] == [False, False]
def test_카드_누름은_노면공을_안_엶(out):
cover = out["cover"]
assert cover["default"] == "pave" # 거르개 없으면 옛 길 그대로(B05)
assert cover["skipped"] is None
assert cover["wallFirst"] == "wall"
assert cover["byId"] == "pave" # 목록 · 알약 고름
def test_화면_배선():
view = _read("B06_Section", "B06_Section_UI_Section_View.ts")
assert '?.group === "G"' in view
assert "highlightPavement(card, pave ? mark : undefined);" in view
panel = _read("B06_Section", "B06_Section_UI_Page_Structures_Panel.ts")
assert panel.count("resolveSelection(selection, pipeFacilities, structures, coverable)") == 2
assert "section.selectAt(selection)" not in panel # 공용 selectAt 은 노면공을 덮어 엶
css = _read("B06_Section", "B06_Section_UI_Style_Cross_Areas.css")
assert ".b06-chart__pavement.is-active" in css