Files
Aislo/resources/tester/test_403_triangle_angle.py
T

48 lines
1.5 KiB
Python

"""403 곡선 없는 교각점(삼각) 각도 글(요구 250-5) — 곡선 창 하단에 곡선 있는 자리와 같은 「내각 N°」.
Node 헬퍼(`helper_403_triangle_angle.cjs`)가 `_Label.curveInfoText` 를 트랜스파일해 돌림.
./venv/Scripts/python.exe -m pytest resources/tester/test_403_triangle_angle.py -q
"""
import json
import subprocess
from pathlib import Path
import pytest
HERE = Path(__file__).resolve().parent
@pytest.fixture(scope="module")
def texts():
proc = subprocess.run(
["node", str(HERE / "helper_403_triangle_angle.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_곡선_있는_자리_그대로(texts):
assert texts["curve"] == "내각 132°"
assert texts["curveOptional"] == "내각 160° · 155° 이상 — 곡선 생략 가능"
def test_삼각_자리도_내각(texts):
assert texts["triangle"] == "내각 133° · 곡선 없음"
assert texts["triangleOptional"] == "내각 168° · 곡선 없음"
def test_내각_모르면_곡선_없음만(texts):
assert texts["triangleUnknown"] == "곡선 없음 — 직선이 그대로 꺾입니다"
def test_화면이_같은_함수를_씀():
label = (HERE.parents[1] / "B05_Profile" / "B05_Profile_UI_RouteEdit_Label.ts").read_text(
encoding="utf-8"
)
assert "info.textContent = curveInfoText(state.curveOn, state.innerAngleDeg" in label