Files
Aislo/resources/tester/test_b05_retaining_wall_height_default.py
T

42 lines
1.6 KiB
Python

# -*- coding: utf-8 -*-
"""옹벽 높이 제안값 2.0 — A4 (2026-09-14 브레인 차례 ③).
등록부 옹벽 높이 기본(=폼의 회색 제안값)이 2.5 였는데 관측 원단위 자료는 반중력식 H=2.0 한 벌뿐 →
[제안값 넣기]를 누르면 표가 안 서는 값이 들어가 「원단위 미확보」 사유만 뜸. 자료가 있는 2.0 으로 내림.
⚠ 기본값은 여전히 **제안**일 뿐 — 칸에 채우지 않음(폼 판정 ①②).
"""
from __future__ import annotations
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from B05_Profile.B05_Profile_Structures_Schema import structure_type_map # noqa: E402
from B08_Quantity.B08_Quantity_Engine_UnitQuantity import expand # noqa: E402
from B08_Quantity.B08_Quantity_Engine_ObservedUnit import load_observed_table # noqa: E402
def _height_default() -> float:
options = {option.key: option for option in structure_type_map()["retaining_wall"].options}
return options["height_m"].default
def test_옹벽_높이_제안값은_자료가_있는_2_0() -> None:
assert _height_default() == 2.0
def test_제안값을_넣으면_표가_선다() -> None:
structure = {
"structure_id": "rw",
"type_id": "retaining_wall",
"start_m": 0.0,
"end_m": 10.0,
"options": {"form": "반중력식", "height_m": _height_default(), "length_m": 10.0},
}
result = expand(structure, {"retaining_wall": "옹벽"}, load_observed_table())
assert result.components, result.notes