- 산출 조건 「초류종자살포 비탈면 토질」(5-24-1 기계/일반 · 5-24-2 기계/마사토 · 서버 선택지 · 제안값 없음) · 비면 금액 없이 입력 사유 - 매핑 `leaf_from`·`leaf_codes` 가 설정값으로 잎 코드를 고름(인계 한 곳 · 갈래 없는 매핑은 종전과 같음) - 936be972 일반 고름 → 인계 FP-05-24-01 막힘 풀림 · B09 는 다음 막힘 「트럭 4.5ton(장비 줄) 카탈로그에 없음 · 종자 규격 미정」으로 아직 금액 없음 · 면고르기 성토면 12,350.32㎡ 40,373,196원 · 절토면 3,087.51㎡ 7,731,123원(파종 면적 그대로 따라감) · 되돌림 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq
67 lines
3.0 KiB
Python
67 lines
3.0 KiB
Python
"""초류종자살포 잎 고르기 — 2026-09-14 브레인 차례 ㉮(B08 나머지 탭 훑기).
|
|
|
|
매핑이 부모(FP-05-24 씨앗뿜어붙이기 · 갈래 고르기형)를 가리켜 B09 가 「잎 미선택」으로 막는데 고를 칸이 없었음
|
|
→ 금액이 영영 안 섬(면고르기와 같은 병). 산출 조건 「초류종자살포 비탈면 토질」(5-24-1 일반 · 5-24-2 마사토)
|
|
칸 · 매핑 `leaf_from`·`leaf_codes` 가 잎 코드로 잇고 · 비면 금액 없이 입력 사유 · 제안값 없음(지어내지 않음).
|
|
"""
|
|
|
|
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_EarthworkSummary import SEED_SPRAY_GROUNDS # noqa: E402
|
|
from B08_Quantity.B08_Quantity_Engine_Handoff import build_handoff # noqa: E402
|
|
|
|
SUMMARY = {"rows": [{"group": "초류종자살포", "item": "", "spec": "씨드스프레이", "unit": "㎡",
|
|
"amount": 1500.0, "application_ratio_pct": 100.0}]} # fmt: skip
|
|
|
|
|
|
def _row(**inputs) -> dict:
|
|
rows = build_handoff(summary_table=SUMMARY, **inputs)["work_items"]
|
|
return next(r for r in rows if r["name"] == "초류종자살포")
|
|
|
|
|
|
def test_토질을_고르면_잎_코드로_감() -> None:
|
|
assert _row(seed_spray_ground="일반")["work_item_code"] == "FP-05-24-01"
|
|
row = _row(seed_spray_ground="마사토")
|
|
assert row["work_item_code"] == "FP-05-24-02" and not row["blocked_kind"], row
|
|
|
|
|
|
def test_토질이_비면_부모_코드에_금액_없이_입력_사유() -> None:
|
|
row = _row()
|
|
assert row["work_item_code"] == "FP-05-24"
|
|
assert row["blocked_kind"] == "input_missing", row
|
|
assert "일반·마사토" in row["blocked_reason"] and "산출 조건" in row["blocked_reason"]
|
|
|
|
|
|
def test_선택지는_마스터_잎_이름과_같음() -> None:
|
|
from B09_Estimation.B09_Estimation_ResourceAxis import load_work_item_master
|
|
|
|
leaves = {
|
|
n["work_item_code"]: n["name"].split("/")[-1]
|
|
for n in load_work_item_master()["work_items"]
|
|
if n.get("parent_code") == "FP-05-24"
|
|
}
|
|
assert leaves == {"FP-05-24-01": "일반", "FP-05-24-02": "마사토"}
|
|
assert set(SEED_SPRAY_GROUNDS) == set(leaves.values())
|
|
|
|
|
|
def test_산출_조건이_받고_선택지_밖은_안_정함으로() -> None:
|
|
source = (ROOT / "B08_Quantity" / "B08_Quantity_Router_Earthwork.py").read_text("utf-8")
|
|
assert '("seed_spray_ground", SEED_SPRAY_GROUNDS)' in source
|
|
assert 'table["seed_spray_choices"]' in source
|
|
material = (ROOT / "B08_Quantity" / "B08_Quantity_Router_Material.py").read_text("utf-8")
|
|
assert 'seed_spray_ground=settings.get("seed_spray_ground") or None' in material
|
|
|
|
|
|
def test_화면_칸이_있고_저장_읽기에_실림() -> None:
|
|
page = (ROOT / "B08_Quantity" / "B08_Quantity_UI_Page.ts").read_text("utf-8")
|
|
assert "seed_spray_ground: draft.seed_spray_ground" in page
|
|
assert "seed_spray_ground: (stored.seed_spray_ground" in page
|
|
assert "appendSeedSprayField(" in page
|