Merge remote-tracking branch 'origin/main_laptop_1' into main_desktop_1

This commit is contained in:
2026-09-09 21:28:26 +09:00
7 changed files with 254 additions and 8 deletions
@@ -90,3 +90,45 @@ def test_안_고르면_계산식으로_서고_그_사실이_적힌다() -> None:
assert .source == "" # 관측 출처가 아니다
assert "0.77" in .basis and "2.65" in .basis
assert any("계산식" in n for n in notes)
def test_두께_칸이_비면_식으로_돈다() -> None:
"""확정 2차 ② 후반 「사용자가 값을 바꿀 수 있게」 — 빈 칸은 「안 정함」이다."""
from B08_Quantity.B08_Quantity_Engine_UnitQuantity import wall_thickness
top, bottom, basis = wall_thickness({}, back_cm=45, height_m=2.5)
assert abs(top - 0.75) < 1e-9 # 뒷길이 0.45 + 0.30
assert abs(bottom - 1.20) < 1e-9 # 상부 + 0.30 × (2.5 1.0)
assert "뒷길이" in basis and "사용자 입력" not in basis
def test_넣은_두께가_식을_이긴다() -> None:
from B08_Quantity.B08_Quantity_Engine_UnitQuantity import wall_thickness
top, bottom, basis = wall_thickness(
{"thickness_top_m": 0.6, "thickness_bottom_m": "1.0"}, back_cm=45, height_m=2.5
)
assert (top, bottom) == (0.6, 1.0)
assert basis.count("사용자 입력") == 2
def test_상부만_넣으면_하부는_그_위에서_식을_잇는다() -> None:
from B08_Quantity.B08_Quantity_Engine_UnitQuantity import wall_thickness
top, bottom, _ = wall_thickness({"thickness_top_m": 0.6}, back_cm=45, height_m=2.5)
assert (top, abs(bottom - 1.05) < 1e-9) == (0.6, True) # 0.6 + 0.30 × 1.5
def test_두께가_입적까지_닿는다() -> None:
"""칸만 만들고 계산이 안 읽으면 「값이 안 닿는」 옛 사고와 같아진다."""
기본, _ = 성분()
두꺼움, _ = 성분(thickness_top_m=1.2, thickness_bottom_m=1.6)
assert 두꺼움["입적"].amount > 기본["입적"].amount
def test_이상한_값은_식으로_돌린다() -> None:
from B08_Quantity.B08_Quantity_Engine_UnitQuantity import wall_thickness
for bad in ("", None, "두꺼움", -1, 0):
top, _, basis = wall_thickness({"thickness_top_m": bad}, back_cm=45, height_m=2.5)
assert abs(top - 0.75) < 1e-9 and "사용자 입력" not in basis, bad