Merge remote-tracking branch 'origin/dev' into main_laptop_1
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""BOX암거·세월교·물넘이포장 — **기본값으로 그린 칸을 그림에 적음** (2026-09-14 브레인 판정 ②③).
|
||||
|
||||
폼이 기본값을 안 보내게 고친 뒤, 비운 칸은 횡단도가 등록부 기본값으로 그리고 있었음. 저장만 안 하면
|
||||
된다고 볼 일이 아님 — 그림이 설계값처럼 보이는 것이 같은 병. 세트 제원이 `defaulted` 「이름 값」을
|
||||
싣고 카드 머리가 「⚠ … 기본값(미확정)」으로 보임. 물넘이 월류 높이가 비면 파임을 안 그리는 까닭도 보임.
|
||||
TS 짝은 거울 시험(`test_b06_culvert_sets_mirror`)이 딕셔너리째 대조함.
|
||||
"""
|
||||
|
||||
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 B06_Section.B06_Section_Engine_Culvert import ( # noqa: E402
|
||||
_box_set,
|
||||
_ford_pavement_set,
|
||||
_ford_set,
|
||||
)
|
||||
|
||||
CHROME = (ROOT / "B06_Section" / "B06_Section_UI_Cross_Card_Chrome.ts").read_text(encoding="utf-8")
|
||||
CONTROLS = (ROOT / "B06_Section" / "B06_Section_UI_Page_Ford_Controls.ts").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
|
||||
def test_BOX_빈_칸은_기본값_목록에_선다() -> None:
|
||||
items = _box_set({})["defaulted"]
|
||||
assert "본체 폭 2" in items and "본체 높이 2" in items
|
||||
assert "유입 날개벽 있음" in items and "유출 날개벽 각도 45" in items
|
||||
|
||||
|
||||
def test_적은_칸은_목록에서_빠진다() -> None:
|
||||
items = _box_set({"body_width_m": 3.0, "wing_in": "없음"})["defaulted"]
|
||||
assert not any(item.startswith("본체 폭 ") for item in items)
|
||||
# 안 세운 날개벽은 치수를 안 봄.
|
||||
assert not any(item.startswith("유입 날개벽") for item in items)
|
||||
assert "본체 높이 2" in items
|
||||
|
||||
|
||||
def test_세월교_월류_폭_관경도_적힌다() -> None:
|
||||
items = _ford_set({"ford_width_m": 12.0})["defaulted"]
|
||||
assert "관경 1000" in items and "월류 높이 0" in items
|
||||
assert not any(item.startswith("월류 폭 ") for item in items)
|
||||
|
||||
|
||||
def test_물넘이_월류_높이가_비면_파임_없음() -> None:
|
||||
spec = _ford_pavement_set({})
|
||||
assert spec["depth_m"] is None
|
||||
assert spec["defaulted"] == ["월류 폭 5"]
|
||||
|
||||
|
||||
def test_카드_머리가_목록과_까닭을_보인다() -> None:
|
||||
assert "기본값(미확정)" in CHROME
|
||||
assert "월류 높이 없음 — 파임 안 그림" in CHROME
|
||||
# 조작으로 값이 오면 목록에서 뺌 — 캐시를 바로 고치는 길.
|
||||
assert CONTROLS.count("dropDefaulted(spec,") == 4
|
||||
@@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""높이 없이 놓인 벽 — **놓기는 되고 줄은 서되 미확정(금액 밖)** (2026-09-14 브레인 판정 ①).
|
||||
|
||||
앞서 B05 폼이 C군 높이가 비면 놓기를 막았음. 우리 규칙 「줄은 서고 금액은 안 섬」과 어긋나 풀고,
|
||||
높이가 물량 밑수인 벽(옹벽·돌쌓기 찰/메·큰돌쌓기)은 B08 표에서 미확정으로 뜨게 함.
|
||||
흙막이(떼 개소당)는 높이를 안 써 그대로.
|
||||
"""
|
||||
|
||||
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 B08_Quantity.B08_Quantity_Engine_UnitQuantity import build_table # noqa: E402
|
||||
from B08_Quantity.B08_Quantity_Engine_UnitQuantity_Base import ( # noqa: E402
|
||||
UNCONFIRMED_NO_HEIGHT,
|
||||
missing_height_reason,
|
||||
)
|
||||
|
||||
COMMIT = (ROOT / "B05_Profile" / "B05_Profile_UI_Structures_Panel_Commit.ts").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
|
||||
def _wall(type_id: str = "masonry_wet", **options) -> dict:
|
||||
return {
|
||||
"structure_id": "w",
|
||||
"type_id": type_id,
|
||||
"start_m": 0.0,
|
||||
"end_m": 10.0,
|
||||
"options": {
|
||||
"length_m": 10.0,
|
||||
"back_len_cm": 45,
|
||||
"stone_kind": "깬돌",
|
||||
"foundation": "기초유",
|
||||
**options,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_높이_없는_돌쌓기는_미확정으로_선다() -> None:
|
||||
table = build_table([_wall()], {"masonry_wet": "돌쌓기(찰)"}, {})
|
||||
row = table["structures"][0]
|
||||
assert row["unconfirmed"] == UNCONFIRMED_NO_HEIGHT
|
||||
|
||||
|
||||
def test_높이를_적으면_미확정이_아니다() -> None:
|
||||
table = build_table([_wall(height_m=2.0)], {"masonry_wet": "돌쌓기(찰)"}, {})
|
||||
assert table["structures"][0]["unconfirmed"] == ""
|
||||
|
||||
|
||||
def test_높이를_안_쓰는_종류는_그대로() -> None:
|
||||
assert missing_height_reason(_wall("soil_guard")) == ""
|
||||
for type_id in ("retaining_wall", "masonry_dry", "boulder_masonry"):
|
||||
assert missing_height_reason(_wall(type_id)) == UNCONFIRMED_NO_HEIGHT, type_id
|
||||
assert missing_height_reason(_wall(type_id, height_m="1.5")) == "", type_id
|
||||
|
||||
|
||||
def test_폼이_높이_빈칸으로_놓기를_안_막는다() -> None:
|
||||
assert "height?.isEmpty()" not in COMMIT
|
||||
Reference in New Issue
Block a user