ACT-001: actuator-first sensor lifecycle
This commit is contained in:
18
tests/actuators/test_actuator_store.py
Normal file
18
tests/actuators/test_actuator_store.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from app.actuators.models import ReconciliationState
|
||||
from app.actuators.store import ActuatorStore
|
||||
|
||||
|
||||
def test_actuator_store_persists_record_and_reconciliation_state(tmp_path: Path) -> None:
|
||||
store = ActuatorStore(tmp_path)
|
||||
store.configure("light.abstellkammer")
|
||||
state = ReconciliationState(last_summary="ok", configured_actuators=1)
|
||||
|
||||
store.save_reconciliation_state(state)
|
||||
|
||||
restarted = ActuatorStore(tmp_path)
|
||||
assert restarted.get("light.abstellkammer").actuator_entity_id == "light.abstellkammer"
|
||||
assert restarted.load_reconciliation_state().last_summary == "ok"
|
||||
Reference in New Issue
Block a user