Files
Aislo/resources/tester/test_87_widening_runs.py
T
eomsangdonandClaude Sonnet 5.5 33119bcc67 feat(B05): 노면공 확폭 구간 상자 · 물넘이 겹침 안내 문구 · 화면 시험 맞춤(87-3 · 87-4)
- 상세 내용 아래 「확폭 구간」 상자: 범위 안 확폭 > 0 측점을 이어진 구간으로 묶어 구간마다 켬/끔 단추(기본 켬) · 끈 구간 = options.widening_off "시작-끝,…"(측점 m) · 안 맞는 값 무시 · 횡단 자료 없으면 안내
- 횡단 측점 읽기 손잡이 pipeSections(design_structure_pipe_calc) · 구간 규칙 design_structure_widening(순수)
- 물넘이 겹침 안내 = 시작 · 종료 측점을 고치라는 문구
- 시험: test_87_widening_runs(새) · ui_checks 52-10 · 52-15 시작 · 종료 측점 꼴로 맞춤

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
2026-10-08 12:08:15 +09:00

61 lines
1.7 KiB
Python

# -*- coding: utf-8 -*-
"""노면공 확폭 구간(PLAN 87-3) — 구간 묶기 · `widening_off` 글 읽고 쓰기 · 안 맞는 값 무시.
규칙은 Node 헬퍼(`helper_87_widening.cjs`)가 `design_structure_widening.ts` 를 그대로 돌림.
"""
import json
import os
import subprocess
import pytest
HERE = os.path.dirname(os.path.abspath(__file__))
@pytest.fixture(scope="module")
def out():
proc = subprocess.run(
["node", os.path.join(HERE, "helper_87_widening.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_곡선_둘은_구간_둘_확폭은_구간_최대(out):
assert out["runs"] == [
{"start_m": 20, "end_m": 60, "widening_m": 0.75},
{"start_m": 100, "end_m": 120, "widening_m": 0.6},
]
def test_범위_안_측점만_묶음(out):
assert out["inner"] == [
{"start_m": 40, "end_m": 60, "widening_m": 0.75},
{"start_m": 100, "end_m": 100, "widening_m": 0.5},
]
assert out["none"] == []
def test_설계_없으면_곡선_확폭_바깥쪽만(out):
assert out["fallback"] == 0.9
assert out["fallbackStraight"] == 0
def test_끈_구간_글_왕복(out):
assert out["off"] == "20-60"
assert out["parsed"] == [[20, 60], [100, 120]] # 틀린 조각은 버림
assert out["isOff"] == [True, False]
assert out["toggledOff"] == "100-120"
assert out["toggledBoth"] == "20-60,100-120"
assert out["toggledOn"] == ""
def test_안_맞는_끈_값은_무시_저장_때_빠짐(out):
assert out["stale"] == "20-60"
assert out["empty"] == ""