From c59dbba482d1d612b28510ce665924791cd1466a Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 14 Sep 2026 13:48:24 +0900 Subject: [PATCH] =?UTF-8?q?fix(b05):=20=EC=98=B9=EB=B2=BD=20=EB=86=92?= =?UTF-8?q?=EC=9D=B4=20=EC=A0=9C=EC=95=88=EA=B0=92=202.5=20=E2=86=92=202.0?= =?UTF-8?q?=20=E2=80=94=20=EA=B4=80=EC=B8=A1=20=EC=9B=90=EB=8B=A8=EC=9C=84?= =?UTF-8?q?=20=EC=9E=90=EB=A3=8C=EA=B0=80=20=EB=B0=98=EC=A4=91=EB=A0=A5?= =?UTF-8?q?=EC=8B=9D=20H=3D2.0=20=ED=95=9C=20=EB=B2=8C=EB=BF=90(A4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq --- B05_Profile/B05_Profile_Structure_Types.json | 3 +- .../test_b05_retaining_wall_height_default.py | 41 +++++++++++++++++++ .../test_b05_structures_registry_policy.py | 7 +++- .../tester/test_b05_structures_router.py | 3 +- 4 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 resources/tester/test_b05_retaining_wall_height_default.py diff --git a/B05_Profile/B05_Profile_Structure_Types.json b/B05_Profile/B05_Profile_Structure_Types.json index 782915b8..ee6b2240 100644 --- a/B05_Profile/B05_Profile_Structure_Types.json +++ b/B05_Profile/B05_Profile_Structure_Types.json @@ -726,7 +726,8 @@ "label": "높이", "input": "number", "unit": "m", - "default": 2.5, + "default": 2.0, + "default_basis": "제안값 2.0 — 관측 원단위 자료가 반중력식 H=2.0 한 벌뿐이라 그 값(2026-09-14 A4 · 옛 2.5 는 자료 없음)", "required": false, "phase": "b05", "empty_means": "비워도 놓임 — 줄만 서고 미확정이라 금액에 안 들어감(높이를 적으면 섬 · 2026-09-14 브레인 판정 ①)" diff --git a/resources/tester/test_b05_retaining_wall_height_default.py b/resources/tester/test_b05_retaining_wall_height_default.py new file mode 100644 index 00000000..9d0435b5 --- /dev/null +++ b/resources/tester/test_b05_retaining_wall_height_default.py @@ -0,0 +1,41 @@ +# -*- 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 diff --git a/resources/tester/test_b05_structures_registry_policy.py b/resources/tester/test_b05_structures_registry_policy.py index e7d154db..2f2c006c 100644 --- a/resources/tester/test_b05_structures_registry_policy.py +++ b/resources/tester/test_b05_structures_registry_policy.py @@ -255,7 +255,12 @@ def test_slope_group_computes_range_from_length(): # 생기며 required는 풀렸다). 후길이 = 길이 − 전길이는 화면 계산값이라 옵션이 # 아니다. 순서는 높이 → 길이 → 전길이. options = {option.key: option for option in item.options} - expected = {"height_m": 2.5, "length_m": 10, "before_m": 5} + # ⚠ 옹벽만 높이 2.0 — 관측 원단위 자료가 반중력식 H=2.0 한 벌뿐(2026-09-14 A4 브레인 판정). + expected = { + "height_m": 2.0 if type_id == "retaining_wall" else 2.5, + "length_m": 10, + "before_m": 5, + } for key, default in expected.items(): assert key in options, f"{type_id}.{key} 옵션 없음" assert options[key].phase == "b05", f"{type_id}.{key}는 b05 phase" diff --git a/resources/tester/test_b05_structures_router.py b/resources/tester/test_b05_structures_router.py index cd843de0..be38399a 100644 --- a/resources/tester/test_b05_structures_router.py +++ b/resources/tester/test_b05_structures_router.py @@ -65,7 +65,8 @@ def test_structure_types_endpoint_returns_registry(client): # (기본값 원칙 ② — 구 저장분 저장 거부 재발 방지). 상세 정책은 registry_policy 테스트. wall = next(item for item in body["types"] if item["type_id"] == "retaining_wall") height = next(option for option in wall["options"] if option["key"] == "height_m") - assert height["required"] is False and height["default"] == 2.5 + # 2026-09-14 A4 — 옹벽 제안값은 자료가 있는 2.0(반중력식 H=2.0 한 벌뿐). + assert height["required"] is False and height["default"] == 2.0 def test_read_structures_empty_project(client):