Skip to content

Commit f0138e4

Browse files
Added PIXIT.REFALM.AlarmThreshold variable to replace static variable for wait threshold. Added missing copyright. Added missing docstring.
1 parent a28b201 commit f0138e4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/python_testing/TC_REFALM_2_2.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#
2+
# Copyright (c) 2024 Project CHIP Authors
13
# All rights reserved.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -29,6 +31,7 @@
2931
# --discriminator 1234
3032
# --passcode 20202021
3133
# --PICS src/app/tests/suites/certification/ci-pics-values
34+
# --int-arg PIXIT.REFALM.AlarmThreshold:5
3235
# --trace-to json:${TRACE_TEST_JSON}.json
3336
# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
3437
# === END CI TEST ARGUMENTS ===
@@ -172,7 +175,9 @@ async def _read_refalm_state_attribute(self):
172175
)
173176

174177
def _wait_thresshold(self):
175-
sleep(self.wait_thresshold_v/1000)
178+
"""Wait the defined time at the PIXIT.REFALM.AlarmThreshold to trigger it."""
179+
logger.info(f"Sleeping for {self.refalm_threshold_seconds} seconds defined at PIXIT.REFALM.AlarmThreshold")
180+
sleep(self.refalm_threshold_seconds)
176181

177182
def _send_named_pipe_command(self, command_dict: dict[str, Any]):
178183
app_pid = self.matter_test_config.app_pid
@@ -201,13 +206,16 @@ def _send_close_door_commnad(self):
201206
@async_test_body
202207
async def test_TC_REFALM_2_2(self):
203208
"""Run the test steps."""
204-
self.wait_thresshold_v = 5000
205209
self.is_ci = self.check_pics("PICS_SDK_CI_ONLY")
206210
self.endpoint = self.get_endpoint(default=1)
207211
cluster = Clusters.RefrigeratorAlarm
208-
209212
logger.info(f"Default endpoint {self.endpoint}")
213+
# Commision the device.
214+
# Read required variables.
210215
self.step(1)
216+
asserts.assert_true('PIXIT.REFALM.AlarmThreshold' in self.matter_test_config.global_test_params, "PIXIT.REFALM.AlarmThreshold must be included on the command line in "
217+
"the --int-arg flag as PIXIT.REFALM.AlarmThreshold:<AlarmThreshold> in seconds.")
218+
self.refalm_threshold_seconds = self.matter_test_config.global_test_params['PIXIT.REFALM.AlarmThreshold']
211219

212220
# check is closed
213221
self.step(2)

0 commit comments

Comments
 (0)