Merge remote-tracking branches 'origin/sub_laptop_3' and 'origin/sub_laptop_8' into sub_laptop_5
This commit is contained in:
@@ -311,6 +311,10 @@ def test_견본_사본_대가_블록(project):
|
||||
assert pct["kind"] == "pct" and pct["base"] == "part:material" and pct["qty"] == 20
|
||||
sc = blocks[b["lines"][3]["key"]]
|
||||
assert sc["kind"] == "사전조합" and b["lines"][3]["qty"] == 4
|
||||
assert (sc["spec"], sc["spec_raw"]) == (
|
||||
"마스터",
|
||||
"SC-T",
|
||||
) # 규격 = 층 낱말 · 번호는 풍선(spec_raw)
|
||||
assert (
|
||||
sc["lines"][0]["kind"] == "sangeun"
|
||||
and sc["lines"][0]["key"] == a["lines"][0]["key"]
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
"""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"
|
||||
|
||||
|
||||
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(D03 / "D03_PlanAnalysis_UI_ForestLayers.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(D03 / "D03_PlanAnalysis_UI_LayerDefs.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)
|
||||
|
||||
|
||||
def test_colors_are_draw_map_tokens() -> None:
|
||||
theme = _read(ROOT / "ui_template" / "ui_template_theme.css")
|
||||
forest = _read(D03 / "D03_PlanAnalysis_UI_ForestLayers.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 # 옛 캔버스 = 한 장 그대로
|
||||
Reference in New Issue
Block a user