Files
Aislo/resources/tester/test_54_9_etc_pill.py
T
eomsangdonandClaude Opus 5.5 c75925ae77 fix(structure): 종단 알약 글 = 종류 칸 이름 · 우클릭 메뉴 클릭이 그래프 선택 해제로 새지 않음(54-49)
- 알약 글 = 좌측 「종류」 칸 · 목록 · 정보 창 1행과 같은 이름(약호 · 기타 머리 자르기 뺌) · 같은 이름 여럿이면 번호
- 알약 겹침 판정 = 이름 글 폭 어림(고정 52px 뺌)
- 공용 우클릭 메뉴 안 click 은 메뉴에서 멈춤 — 배관 고른 채 군 머리를 누르면 그래프 빈 곳 클릭으로 새어 폼 리셋 · 메뉴 사라짐
- 시험: test_54_9_etc_pill 새 규칙 · 헬퍼 json 불러오기

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rJwJMVL4EE31y77TB11AP
2026-10-06 16:06:24 +09:00

67 lines
2.3 KiB
Python

# -*- coding: utf-8 -*-
"""54-9 → 54-49 종단 알약 글 = 좌측 「종류」 칸 · 목록과 같은 이름.
• 종류 이름(정의 이름) · 기타는 손 이름 · 같은 이름 여럿이면 목록과 같은 번호 · 빈 이름 = 「기타 N」
• 약호 · 머리 자르기(옛 54-9 규칙) 안 씀 — 알약 = 툴팁 이름
화면 그릇 없이 Node 헬퍼가 TS 를 트랜스파일해 돌린다(`helper_54_9_etc_pill.cjs`).
B05 · B06 은 같은 알약 레인(`buildStructureLane`)을 씀 — 실제 화면은 ORCA 로 따로 본다.
"""
import json
import os
import subprocess
import pytest
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = os.path.abspath(os.path.join(HERE, "..", ".."))
@pytest.fixture(scope="module")
def out():
proc = subprocess.run(
["node", os.path.join(HERE, "helper_54_9_etc_pill.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_53_2_기타_다섯_알약이_손_이름과_번호(out):
pills = {key: value["pill"] for key, value in out["scenario"].items()}
assert pills == {
"e1": "배수로정비 1",
"e2": "울타리",
"e3": "기타 1",
"e4": "배수로정비 2",
"e5": "기타 2",
}
def test_알약은_툴팁_이름과_같다(out):
for group in out.values():
for value in group.values():
assert value["pill"] == value["name"]
def test_머리가_같은_이름도_자르지_않는다(out):
pills = [value["pill"] for value in out["prefix"].values()]
assert pills == ["콘크리트 블록", "콘크리트 옹벽", "배수로", "배수로공", "기타 시설", "기타"]
def test_다른_종류_알약은_종류_이름과_번호(out):
pills = {key: value["pill"] for key, value in out["others"].items()}
assert pills == {"w1": "옹벽 1", "w2": "옹벽 2", "x1": "가로등", "x2": "기타"}
def test_알약_레인이_글을_한_곳에서_받는다():
with open(
os.path.join(ROOT, "B05_Profile", "B05_Profile_UI_Structures_Marks.ts"), encoding="utf-8"
) as handle:
text = handle.read()
assert "mark.textContent = pill;" in text
assert text.count("structurePillTexts(") == 2 # 정의 하나 · 레인 하나