Files
Aislo/resources/tester/test_b09_consumables_helicopter.py
eomsangdonandClaude Opus 5 9563d0604a feat(b09): ㉡ 유인헬기방제 8-6-1 소요재료·양수기 손료 — 2장 표 읽는 한 벌에 면적·일 꼴(AreaSet) 더함 · 지상방제는 막힌 채 사유
· 양수기 1대 1일 호표 = 휘발유 10ℓ(2-1-8) + 잡품 주재료비 95% + 손료 0.0084(2-2-6) × 구입가(칸)
· 갈래 「(160ha당)」·「(400ha당)」 = 1일 작업량으로 나눔([주]① 대형도 휘발유 10ℓ) · 깃발은 표의 「20ha당 1개」 를 읽어 ha당 · 헬기 임차료는 견적 칸
· [주]② 소방관서 급수 지원이면 휘발유 미반영 — 사유 한 줄
· 연료값 읽기를 「ℓ 은 첫 수 · % 는 % 가 붙은 칸」 으로 넓힘(체인톱 값 그대로)
· 자원 목록 이름을 「유인헬기방제 양수기·깃발」 로 — 「양수기」 로 두면 12-26 물푸기 양수기 줄 풀이가 바뀌는 것을 잰 뒤 피함
· 8-6-3 지상방제는 밑수 없음으로 막힌 채 사유 둘(1일 작업량이 원문에 없음 · 15ha 는 연료 설명 / 1톤 방제차량은 카탈로그에 1톤 트럭이 없음)

오른 제목: 8-6-1 소형 +227원/ha · 대형 +90 · 나머지 그대로 · 잴 시험 다섯 빨강→초록 · 끄기 넷 빨강 · 전체 시험 1712 + 388 통과

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
2026-09-15 02:47:59 +09:00

78 lines
3.2 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""유인헬기방제 8-6-1 소요재료·양수기 손료 — 2026-09-15 브레인 판정 ①③(2장 표 읽는 한 벌에 면적 꼴 더함).
2-1-8 유인 헬기(160ha당): 휘발유(양수기) 10ℓ · 잡품 주재료비의 95% · 깃발 8개(20ha당 1개)
[주]① 대형헬기도 휘발유 10ℓ ③ 깃발은 20ha당 1개 · 2-2-6 양수기 5HP 손료 0.0084(1일 1대)
⇒ 표의 「160ha당」 이 1일 작업량 — 양수기 1대 1일 호표(휘발유 10ℓ + 잡품 95% + 손료)를 소형 ÷160ha · 대형 ÷400ha
깃발은 ha당 1/20 개 · 양수기 구입가·깃발·헬기 임차료는 「자재 단가」 칸 + 사유(③)
(앞서 인력이 갈래 밑수로 안 나뉘어 160·400배 부풀던 것은 `test_b09_variant_basis` 가 바로잡음)
"""
from __future__ import annotations
from decimal import Decimal
from B09_Estimation.B09_Estimation_UnitPrice import cached_build
PUMP = "X-AR-X-ea09a419"
PUMP_PRICE = "AR-M-cfc70216"
FLAG = "AR-M-a79b4d20"
HELI = "AR-M-08db9ecc"
SMALL = "B-FP-08-06-01#소형헬기(160ha당)"
LARGE = "B-FP-08-06-01#대형헬기(400ha당)"
def _row(book, title: str, code: str):
return next((r for r in book.details[title] if r.ref_code == code), None)
def test_양수기_1대_1일_호표는_휘발유_10리터와_잡품_95퍼센트() -> None:
book = cached_build().book
fuel = _row(book, PUMP, "M-FUEL-휘발유")
assert fuel.quantity == Decimal(10), fuel
misc = next(r for r in book.details[PUMP] if r.percent_of_material is not None)
assert misc.percent_of_material == Decimal(95)
def test_소형은_160ha_대형은_400ha_로_나눈_하루_몫() -> None:
book = cached_build().book
assert _row(book, SMALL, PUMP).quantity == Decimal(1) / 160
assert _row(book, LARGE, PUMP).quantity == Decimal(1) / 400
def test_깃발_헬기임차료_양수기가격은_칸_넣으면_ha당으로() -> None:
none = cached_build()
left = " ".join(none.unattached.get("FP-08-06-01", []))
assert "깃발" in left and "헬기 임차료" in left and "양수기가격" in left, left
priced = cached_build(
material_prices=(
(FLAG, "15000", "견적"),
(HELI, "3000000", "견적"),
(PUMP_PRICE, "800000", "견적"),
)
)
book = priced.book
assert _row(book, SMALL, FLAG).quantity == Decimal(1) / 20
assert _row(book, LARGE, FLAG).quantity == Decimal(1) / 20
assert _row(book, SMALL, HELI).quantity == Decimal(1) / 160
assert _row(book, LARGE, HELI).quantity == Decimal(1) / 400
assert book.resolve(PUMP).expense == Decimal(6720) # 800,000 × 0.0084
def test_소방관서_급수_지원이면_휘발유_미반영_단서를_보임() -> None:
from B09_Estimation.B09_Estimation_KnownGaps import known_gap_note
assert "소방관서" in known_gap_note("FP-08-06-01")
def test_지상방제는_막힌_채_사유만_보탬() -> None:
build = cached_build()
assert "FP-08-06-03" in build.basis_missing
left = " ".join(build.unattached.get("FP-08-06-03", []))
assert "15ha 는 연료 설명" in left and "1톤 트럭이 없음" in left, left
assert not any(
r.ref_code.startswith("M-FUEL")
for t in build.book.titles
if t.startswith("B-FP-08-06-03")
for r in build.book.details[t]
)