REPOSITORY
kitech/greenhouse-rail-entry-safety Private
[참조 MVP] 온실 레일 진입·안전 제어 — 온실 레일 진입 조건, 안전영역, 에너지 상태를 판정하는 참조 MVP입니다.
https://git.agrithing.ai/kitech/greenhouse-rail-entry-safety.git a0de086 feat: 온실 레일 진입·안전 제어 구체 MVP 구현
2b34ed4 ci: add static dynamic and evidence gates
5542935 feat: add executable institution reference MVP
9affcc1 docs: define product role and interface contract
1 items · feat/concrete-mvp-v2
·/ tests/test_component.py
python · 1.2 KB · c7ee3a1 Download
from __future__ import annotationsimport jsonimport unittestfrom pathlib import Pathfrom asw_component import executeROOT = Path(__file__).resolve().parents[1]class ComponentTest(unittest.TestCase): def test_reference_scenario(self): payload = json.loads((ROOT / "examples/input.json").read_text(encoding="utf-8")) result = execute(payload) self.assertTrue(result["accepted"]) self.assertEqual(result["component"], "kitech/greenhouse-rail-entry-safety") self.assertEqual(result["target"], "mcu") self.assertEqual(result["status"], "ENTRY_ALLOWED") self.assertEqual(result["command"], "ENTER_RAIL") self.assertEqual(result["allowedSpeedMps"], 0.2) def test_safety_or_failure_path(self): payload = json.loads((ROOT / "examples/failure-input.json").read_text(encoding="utf-8")) result = execute(payload) self.assertEqual(result["component"], "kitech/greenhouse-rail-entry-safety") self.assertFalse(result["accepted"]) self.assertEqual(result["command"], "STOP") self.assertIn("SAFETY_ZONE_OCCUPIED", result["blockingReasons"])if __name__ == "__main__": unittest.main()