Files
Aislo/resources/tester/test_622_2_forest_layers.py
T
eomsangdonandClaude Opus 5.5 a6ef53e8a3 feat(공용 지도 겹): 임도 짐작 걷음 · 그 자리 = 임도망도(전국 국가임도 · route 아이콘 · 범례 「임도망도 간선 · 작업 · 산불」 · 줌 14 부터 연도 · 종류 글) · 올린 임도망도 = 임도(업로드)(위치 칸 단추 · 목록 · 알림 · 서버 글) (PLAN 630 · 요구 532 · 534)
- 열쇠 그대로(nationalRoad · forestRoadFile) — 옛 켬끔 취향 이어짐 · forestRoad 열쇠 · 도로 소로 거름은 B05 자료 셈 이음으로 남김(겹 목록 · 꼴 · 범례만 걷음)
- 기존 도로(road) 겹 · 소스 · 범례 그대로
- 시험 553_4 겹 차례 · 584_3 범례 기대값을 새 이름으로 고침 · 622_2 에 630 · 534 지킴 덧

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:10:58 +09:00

69 lines
3.4 KiB
Python

"""PLAN 622-2 — 예정노선 받은 산림 · 환경 자료 겹 다섯(국유림 임도 · 산림입지도 · 경제림 · 생태자연도 · 산사태) 화면 지킴.
./venv/Scripts/python.exe -m pytest resources/tester/test_622_2_forest_layers.py -q
"""
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
D03 = ROOT / "D03_PlanAnalysis"
MAP = ROOT / "A00_Common" / "map" # 624-2 공용 지도 부품
def _read(path: Path) -> str:
return path.read_text(encoding="utf-8")
def test_fixed_sources_follow_plan_622_routes() -> None:
gl = _read(ROOT / "ui_template" / "ui_template_gl_map.ts")
assert "export function tileSource" in gl
assert "/plan/${path}/{z}/{x}/{y}.${ext}" in gl
forest = _read(MAP / "map_forest_layers.ts")
for name in ("forest_road", "forest_soil", "eco_forest"):
assert f'vt("{name}")' in forest
assert f'...vector("{name}")' in forest or f'"source-layer": "{name}"' in forest
for name in ("ecology", "landslide"):
assert f'wmt("{name}")' in forest
assert '`vt/${name}`, "pbf", 8, 15' in forest and '`wmt/${name}`, "png", 6, 19' in forest
assert "minzoom: 10" in forest # 산림입지도 z10 아래 숨김
base = _read(D03 / "D03_PlanAnalysis_UI_MapGl.ts")
assert "...forestSources(projectId)" in base
assert 'raster("landslide"' not in base # 산사태 = 조각(한 장 GL 그림 없음)
assert "TRACKED_SOURCES.includes(event.sourceId)" in base # 받는 동안 서클
def test_layer_list_five_off_by_default() -> None:
defs = _read(MAP / "map_layer_list.ts")
icons = _read(ROOT / "ui_template" / "ui_template_icons.ts")
for key in ("nationalRoad", "soils", "ecoForest", "ecology", "landslide"):
entry = re.search(rf'key: "{key}",\s*icon: "(\w+)",[^}}]*on: (\w+)', defs)
assert entry and entry.group(2) == "false", key
assert re.search(rf"^\s+{entry.group(1)}:", icons, re.M), entry.group(1)
# 630 — 임도망도 = 짐작 자리 · route 아이콘 · 짐작 겹 걷음
assert re.search(r'key: "nationalRoad",\s*icon: "route",\s*title:\s*"임도망도\(', defs)
assert 'key: "forestRoad",' not in defs
assert "item(`임도망도 ${label}`" in _read(MAP / "map_forest_layers.ts")
forest = _read(MAP / "map_forest_layers.ts")
assert '"nationalRoad-label"' in forest and "minzoom: 14" in forest # 534 줌인 글
assert '["get", "year"]' in forest and '"symbol-placement": "line"' in forest
assert "forestRoadLabelSpec()," in _read(MAP / "map_layer_specs.ts")
def test_colors_are_draw_map_tokens() -> None:
theme = _read(ROOT / "ui_template" / "ui_template_theme.css")
forest = _read(MAP / "map_forest_layers.ts")
for token in set(re.findall(r'"(--draw-map-[\w-]+)"', forest)):
assert f"{token}:" in theme, token
assert all(f"--draw-map-soil-{n}:" in theme for n in range(1, 7))
assert not re.search(r"#[0-9a-fA-F]{6}\b(?!\")", forest) # 색 = 토큰(뒷값만 글)
def test_canvas_keeps_old_landslide_and_layers_file_not_grown() -> None:
layers = _read(D03 / "D03_PlanAnalysis_UI_Layers.ts")
assert len(layers.splitlines()) <= 688
assert '(glOn && key === "landslide")' in layers # GL = 조각 · 받기 없음
assert "if (!glOn) void Promise.all(LAYERS.map((def) => ensure(def.key)))" in layers
paint = _read(D03 / "D03_PlanAnalysis_UI_LayerPaint.ts")
assert "drawRaster(context, map, data.landslide);" in paint # 옛 캔버스 = 한 장 그대로