Files
Aislo/resources/tester/test_634_2_hover_table.py
T
eomsangdonandClaude Opus 5.5 f6cfaf446c feat(760-1): 암상 지질도 겹 · 노선 따라 바위 종류 구간 · 밖 겹 출처 줄
- 서버: 지오빅데이터(KIGAM) 수치지질도 1:50,000 — WFS 암상 면(깨진 한글 칸은 기호별 점 조회로 채움) · 받은 범위 ∪ 노선으로 자름 · 저장본 · 노선 따라 1 m 표본 구간 · 키는 서버만(.env GEOBIGDATA_API_KEY · 쿼리 key)
- 그림 조각 대리에 geology(키 쿼리 이름 칸 key_param · 옛 겹 serviceKey 그대로)
- 화면(D03 · B05): 「제한·재해」에 「암상 지질도」 — 그림 조각 + 갈래 색 면 · 「기호 · 암상」 글 · 범례 · 노선 구간 표(참고 — 토사 · 암 판정 아님)
- 켠 밖 겹마다 범례 맨 아래 출처 줄(브이월드 · 국토지리정보원 · 산림청 · 환경부 · 생활안전지도 공공누리 · 한국지질자원연구원 CC BY-NC)
- 범례 칸 높이 한도 · 밀기(낮은 화면)
- 시험: test_760_1 새로 · test_634_2 · test_553_4 겹 차례 표에 geology 한 줄 더함(새 겹 · 낡은 표)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 08:32:53 +09:00

109 lines
4.6 KiB
Python

"""634-2 표 두 장(요구 546) — 그룹1 22 겹 호버제목 · 묶음 · 그룹2 17 줄 호버제목 · 페이지 덮어쓰기 없음 · 계류 · 도로 띠 둘."""
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
MAP = ROOT / "A00_Common" / "map"
def _read(path: Path) -> str:
return path.read_text(encoding="utf-8")
# 요구 546 그룹1 표(호버제목 · 아이콘 그룹명) + 도로300m(표 밖 · 「도로」 묶음)
GROUP1 = [
("satellite", "위성사진", None),
("hillshade", "음영기복도", None),
("contour", "등고선", None),
("slope", "급경사", None),
("stream", "세류", "water"),
("water", "하천", "water"),
("zeroOrder", "0차곡", "water"),
("bands", "계류100m", "water"),
("road", "도로", "road"),
("nationalRoad", "임도망도", "road"),
("forestRoadFile", "임도(업로드)", "road"),
("roadBands", "도로300m", "road"),
("cadastral", "지적도", "land"),
("building", "건물", "land"),
("place", "지명", "land"),
("zones", "보호규제구역", "limit"),
("soils", "산림입지도", "limit"),
("ecoForest", "국유림·사유림", "limit"),
("ecology", "생태자연도", "limit"),
("landslide", "산사태위험지도", "limit"),
("landslideZones", "산사태취약지역", "limit"),
("geology", "암상 지질도", "limit"), # 760-1 더함
("faults", "단층", "limit"),
("lineaments", "지질구조선", "limit"),
]
GROUP2 = [
("hint-toggle", "도움말"),
("undo", "되돌리기"),
("redo", "다시하기"),
("view3d", "3D"),
("rotate-ccw", "좌 회전"),
("rotate-cw", "우 회전"),
("contour-minor", "등고선 1m"),
("stations", "측점"),
("slopes", "길이·기울기"),
("footprint", "절성토선"),
("measure", "길이측정"),
("station-snap", "스냅"),
("recommend", "추천노선"),
("terrain", "수치지형도/라이다"),
]
def test_그룹1_표_차례_호버_묶음():
src = _read(MAP / "map_layer_list.ts")
rows = re.findall(r'row\("(\w+)", "\w+", "([^"]+)", (?:"(\w+)"|null)', src)
assert [(k, t, g or None) for k, t, g in rows] == GROUP1
for name in ("수계망도", "도로", "토지·건물", "제한·재해"):
assert f'name: "{name}"' in src
# 표 「사용」 = 두 페이지 모두 · 숨김 표 없음
assert "pages: BOTH" in src and "hide" not in src[src.index("MAP_LAYER_PAGES") :]
def test_그룹2_표_호버():
src = _read(MAP / "map_toolbar.ts")
rows = re.findall(r'key: "([\w-]+)",\s+title: "([^"]+)"', src)
assert rows == GROUP2
tools = _read(ROOT / "ui_template" / "ui_template_map_tools.ts")
for key, title in GROUP2[1:-2]: # 추천 · 지형 = 페이지 요소
assert re.search(rf'"?{key}"?: \{{ icon: "\w+", title: "{title}"', tools), key
def test_페이지_호버_덮어쓰기_없음():
files = [
ROOT / "B05_Profile" / "B05_Profile_UI_RouteEdit_Chrome.ts",
ROOT / "D03_PlanAnalysis" / "D03_PlanAnalysis_UI_Map.ts",
ROOT / "A00_Common" / "design" / "design_view_profile_3d_modal.ts",
]
for path in files:
for call in re.findall(r"mapToolButton\([^)]*\)", _read(path), re.S):
assert "title" not in call, (path.name, call)
layers = _read(ROOT / "B05_Profile" / "B05_Profile_UI_RouteEdit_Layers.ts")
assert (
"layerBar.root.querySelector" not in layers
and "layerBar.sync({ ready: !!meta, glOn, why })" in layers
)
assert 'forestRoadFile: "받은 임도 자료 없음"' in layers # B05 임도(업로드) 막힘 + 까닭
edit = _read(ROOT / "B05_Profile" / "B05_Profile_UI_RouteEdit.ts")
assert 'mapToolTip(minorContourButton, contours?.minor ? null : "LAS 등고선 없음")' in edit
bar = _read(MAP / "map_layer_bar.ts")
assert 'const GL_TITLE = "그래픽 카드";' in bar and "multi: true" in bar
def test_계류_도로_띠_둘():
specs = _read(MAP / "map_layer_specs.ts")
assert 'fillEdge("roadBands", "bands"' in specs and 'fillEdge("bands", "bands"' in specs
assert specs.index('fillEdge("roadBands"') < specs.index('fillEdge("bands", "bands"') # 옛 차례
legend = _read(MAP / "map_legend.ts")
assert "...(on.bands" in legend and "...(on.roadBands" in legend
paint = _read(ROOT / "D03_PlanAnalysis" / "D03_PlanAnalysis_UI_LayerPaint.ts")
assert "if (on.roadBands)" in paint and "if (on.bands)" in paint
b05 = _read(ROOT / "B05_Profile" / "B05_Profile_UI_RouteEdit_Layers.ts")
assert 'key === "bands" || key === "roadBands"' in b05 and "fetchPlanBands(projectId)" in b05