Skip to content

Commit 81856d1

Browse files
committed
tests: Add mock tests for HTS221 auto-trigger after poweroff.
1 parent 2f8e6e3 commit 81856d1

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

tests/runner/executor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ def run_action(action, driver_instance):
118118
119119
Returns the result value from the action.
120120
"""
121+
# Run optional setup steps before the main action
122+
for step in action.get("setup", []):
123+
method = getattr(driver_instance, step["method"])
124+
method(*step.get("args", []))
125+
121126
action_type = action["action"]
122127

123128
if action_type == "call":

tests/scenarios/hts221.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,30 @@ tests:
8585
expect_not_none: true
8686
mode: [mock, hardware]
8787

88+
- name: "Auto-trigger temperature after poweroff"
89+
action: call
90+
setup:
91+
- method: poweroff
92+
method: temperature
93+
expect_not_none: true
94+
mode: [mock]
95+
96+
- name: "Auto-trigger humidity after poweroff"
97+
action: call
98+
setup:
99+
- method: poweroff
100+
method: humidity
101+
expect_not_none: true
102+
mode: [mock]
103+
104+
- name: "Auto-trigger read after one-shot mode"
105+
action: call
106+
setup:
107+
- method: trigger_one_shot
108+
method: read
109+
expect_not_none: true
110+
mode: [mock]
111+
88112
- name: "Auto-trigger after poweroff"
89113
action: hardware_script
90114
script: |

0 commit comments

Comments
 (0)