- 관 길이 = 유출 벽 자리에서 셈(0.1 m) · 정수 올림 연장 · 길이 맞춤 이동(_Culvert_Fit) 없앰 - 관보호공 ◀▶▲▼ · 끌기 0.1 m 걸음(세월교 흙막이만 1 m) · ◀▶ 때 d 빈 칸은 지금 자리로 묶음 - 관 · 세월교 정보 글 = 노폭 · 노견 라벨 바로 위 줄 · 카드 · 좌측 패널 「정수 m (소수 첫째)」 - 구조물 집계(M02_Table_Fill) 관연장 = 사사오입 정수 · TS pipeLengthWhole 짝 · 새 시험 test_225_1 - 정수 맞춤 없앰에 맞춰 139_6 · 186_1 · 108 · 79 기대값 고침 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JywHxQuWPk6UYXTebyrBoU
61 lines
2.5 KiB
Python
61 lines
2.5 KiB
Python
"""139-6 노견을 넓힌 유출 쪽 관 길이 자리 — 사면 우선(물매 1:1.2 그대로) + 유출 벽 높이 역산(0.1 m).
|
|
|
|
설계선 엔진으로 노견 확장 설계를 내고 배수관 기하를 돌린 값(`helper_139_6_pipe_fit.cjs` · B07 픽스처
|
|
배관 85.052 · 유출 = 좌). 225-1 부터 정수 길이 맞춤 · 높이 역산 없음 — 관 길이 = 그려진 길이 0.1 m.
|
|
"""
|
|
|
|
import json
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
if str(ROOT) not in sys.path:
|
|
sys.path.insert(0, str(ROOT))
|
|
|
|
from config.config_system import STANDARD_CROSS_SECTION # noqa: E402
|
|
|
|
HELPER = Path(__file__).parent / "helper_139_6_pipe_fit.cjs"
|
|
|
|
pytestmark = pytest.mark.skipif(
|
|
not (ROOT / "config" / "node_modules").is_dir(), reason="프론트엔드 의존성 미설치"
|
|
)
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def out(tmp_path_factory) -> dict:
|
|
standard = tmp_path_factory.mktemp("std") / "standard.json"
|
|
standard.write_text(json.dumps(STANDARD_CROSS_SECTION), encoding="utf-8")
|
|
done = subprocess.run( # noqa: S603 — 고정 실행 파일
|
|
["node", str(HELPER), str(standard)],
|
|
cwd=str(ROOT),
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
)
|
|
assert done.returncode == 0, done.stderr
|
|
return json.loads(done.stdout)
|
|
|
|
|
|
def test_안_넓힌_측점은_종전_그대로(out: dict) -> None:
|
|
"""225-1 — 정수 맞춤 없앰: 벽은 기본 자리 · 관 길이 = 그려진 길이 0.1 m(5.772 → 5.8)."""
|
|
base = out["base"]
|
|
assert (base["edge"], base["pureHeight"], base["lengthM"]) == (2, 2, 5.8)
|
|
assert base["cut"] == pytest.approx(5.772)
|
|
|
|
|
|
@pytest.mark.parametrize("name, extend", [("shifted", 1.0), ("shifted2", 1.3)])
|
|
def test_넓힌_쪽은_물매_그대로_높이_역산(out: dict, name: str, extend: float) -> None:
|
|
case = out[name]
|
|
assert case["edge"] == pytest.approx(2 + extend) and case["extend"] == extend
|
|
assert case["slope"] == pytest.approx(1.2, abs=0.05) # 사면 우선 — 물매 그대로
|
|
assert round(case["pureHeight"] * 10) == pytest.approx(case["pureHeight"] * 10) # 0.1 m 눈금
|
|
assert case["lengthM"] == round(case["cut"], 1) # 225-1 — 길이는 벽 자리에서 셈(올림 없음)
|
|
|
|
|
|
def test_높이가_실제로_바뀜(out: dict) -> None:
|
|
"""225-1 — 길이 맞춤 높이 역산 없앰: 1.3 m 넓혀도 유출 벽 높이는 기본 2.0 그대로."""
|
|
assert out["shifted2"]["pureHeight"] == pytest.approx(2.0)
|