41 lines
1.4 KiB
Python
41 lines
1.4 KiB
Python
"""606-1 위성 바탕 밝기 지킴 — D03 위성 칠에 밝기 상한 · 채도 · 사용자 조절 칸 · 갈래 굵기 3 (B04 · B05 위성은 그대로).
|
|
|
|
./venv/Scripts/python.exe -m pytest resources/tester/test_606_1_sat_light.py -q
|
|
"""
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
read = lambda rel: (ROOT / rel).read_text(encoding="utf-8") # noqa: E731
|
|
|
|
MAPGL = read("D03_PlanAnalysis/D03_PlanAnalysis_UI_MapGl.ts")
|
|
LIGHT = read("D03_PlanAnalysis/D03_PlanAnalysis_UI_SatLight.ts")
|
|
LAYERS = read("D03_PlanAnalysis/D03_PlanAnalysis_UI_Layers.ts")
|
|
|
|
|
|
def test_위성_칠에_밝기_채도():
|
|
assert re.search(r'raster\("satellite", 1, \{[^}]*"raster-brightness-max": light', MAPGL)
|
|
assert '"raster-saturation": SAT_SATURATION' in MAPGL
|
|
|
|
|
|
def test_밝기_처음값은_어둡게_범위_안():
|
|
m = {k: float(v) for k, v in re.findall(r"SAT_LIGHT_(MIN|MAX|DEFAULT) = ([\d.]+)", LIGHT)}
|
|
assert m["MIN"] < m["DEFAULT"] < m["MAX"] == 1
|
|
|
|
|
|
def test_조절_칸은_GL_위성_켠_때만_기억():
|
|
assert "createSatLightRow(" in LAYERS
|
|
assert "glOn && on.satellite" in LAYERS
|
|
assert "aislo:pref:d03.satellite-light" in LIGHT
|
|
|
|
|
|
def test_갈래_굵기_3():
|
|
paint = read("D03_PlanAnalysis/D03_PlanAnalysis_UI_DrawPaint.ts")
|
|
assert "const width = 3;" in paint
|
|
assert "branch ? 2.5" not in paint
|
|
|
|
|
|
def test_공용_GL_바탕은_안_바뀜():
|
|
assert "brightness" not in read("ui_template/ui_template_gl_map.ts")
|