Files
Aislo/resources/tester/test_75_profile_strip.py
T

43 lines
1.9 KiB
Python

"""편집 창 종단 띠 — 없앰(345-5 · 아래 종단 판 종단 그래프가 그 몫) · [확인] 목표 셈 그대로.
./venv/Scripts/python.exe -m pytest resources/tester/test_75_profile_strip.py -q
"""
import asyncio
from pathlib import Path
from uuid import uuid4
from B05_Profile import B05_Profile_Router_RouteInitial as initial
ROOT = Path(__file__).resolve().parents[2]
B05 = ROOT / "B05_Profile"
def _read(name: str) -> str:
return (B05 / name).read_text(encoding="utf-8")
def test_띠_없음_화면_요청_서버_길():
assert not (B05 / "B05_Profile_UI_RouteEdit_ProfileStrip.ts").exists()
chrome = _read("B05_Profile_UI_RouteEdit_Chrome.ts")
assert "data-strip" not in chrome and "종단 띠" not in chrome
assert "routeedit__strip" not in _read("B05_Profile_UI_Style_RouteEdit.css")
editor = _read("B05_Profile_UI_RouteEdit.ts")
assert "ProfileStrip" not in editor and "strip." not in editor
# [노선 반영]의 균형 종단 여부 = 지금 추천 갈래(띠가 보이던 값과 같은 규칙)
assert "profileShown: async () => initial.withProfile()," in editor
assert "profile-preview" not in _read("B05_Profile_Api_Replan.ts")
assert "is-tick" not in _read("B05_Profile_UI_RouteEdit_Recommend_Profile.ts")
assert not hasattr(initial, "profile_preview") and not hasattr(initial, "ProfilePreviewRequest")
paths = {getattr(r, "path", "") for r in initial.replan.router.routes}
assert not any(p.endswith("/route/profile-preview") for p in paths)
def test_확인_목표는_같은_셈의_측점_계획고(monkeypatch, tmp_path: Path) -> None:
async def profile_of(*_args):
return {"stations_m": [0.0, 20.0, 31.5], "plan_m": [5.0, 6.0, 6.5], "cut_m3": 1.0}
monkeypatch.setattr(initial, "balanced_profile_of", profile_of)
target = asyncio.run(initial.balanced_target(uuid4(), tmp_path, [], None))
assert target == ([0.0, 20.0, 31.5], [5.0, 6.0, 6.5])