@@ -102,29 +102,29 @@ def pics_TC_REFALM_2_2(self):
102
102
def steps_TC_REFALM_2_2 (self ) -> list [TestStep ]:
103
103
"""Execute the test steps."""
104
104
steps = [
105
- TestStep ( 1 , "Commission DUT to TH (can be skipped if done in a preceding test)" ,is_commissioning = True ),
106
- TestStep ( 2 , "Ensure that the door on the DUT is closed" ),
107
- TestStep ( 3 , "TH reads from the DUT the State attribute" ),
108
- TestStep ( 4 , "Manually open the door on the DUT" ),
109
- TestStep ( 5 , "Wait for the time defined in PIXIT.REFALM.AlarmThreshold" ),
110
- TestStep ( 6 , "TH reads from the DUT the State attribute" ),
111
- TestStep ( 7 , "Ensure that the door on the DUT is closed" ),
112
- TestStep ( 8 , "TH reads from the DUT the State attribute" ),
113
- TestStep ( 9 , "TH sends Reset command to the DUT" ),
114
- TestStep ( 10 , "TH sends ModifyEnabledAlarms command to the DUT" ),
115
- TestStep ( 11 , "Set up subscription to the Notify event" ),
116
- TestStep ( "12.a" , "Repeating step 4 Manually open the door on the DUT" ),
117
- TestStep ( "12.b" , "Step 12b: Repeat step 5 Wait for the time defined in PIXIT.REFALM.AlarmThreshold" ),
118
- TestStep ( "12.c" , "After step 5 (repeated), receive a Notify event with the State attribute bit 0 set to 1." ),
119
- TestStep ( "13.a" , "Repeat step 7 Ensure that the door on the DUT is closed" ),
120
- TestStep ( "13.b" , "Receive a Notify event with the State attribute bit 0 set to 0" ),
105
+ TestStep (1 , "Commission DUT to TH (can be skipped if done in a preceding test)" , is_commissioning = True ),
106
+ TestStep (2 , "Ensure that the door on the DUT is closed" ),
107
+ TestStep (3 , "TH reads from the DUT the State attribute" ),
108
+ TestStep (4 , "Manually open the door on the DUT" ),
109
+ TestStep (5 , "Wait for the time defined in PIXIT.REFALM.AlarmThreshold" ),
110
+ TestStep (6 , "TH reads from the DUT the State attribute" ),
111
+ TestStep (7 , "Ensure that the door on the DUT is closed" ),
112
+ TestStep (8 , "TH reads from the DUT the State attribute" ),
113
+ TestStep (9 , "TH sends Reset command to the DUT" ),
114
+ TestStep (10 , "TH sends ModifyEnabledAlarms command to the DUT" ),
115
+ TestStep (11 , "Set up subscription to the Notify event" ),
116
+ TestStep ("12.a" , "Repeating step 4 Manually open the door on the DUT" ),
117
+ TestStep ("12.b" , "Step 12b: Repeat step 5 Wait for the time defined in PIXIT.REFALM.AlarmThreshold" ),
118
+ TestStep ("12.c" , "After step 5 (repeated), receive a Notify event with the State attribute bit 0 set to 1." ),
119
+ TestStep ("13.a" , "Repeat step 7 Ensure that the door on the DUT is closed" ),
120
+ TestStep ("13.b" , "Receive a Notify event with the State attribute bit 0 set to 0" ),
121
121
]
122
122
123
123
return steps
124
124
125
- async def get_command_status (self ,cmd : ClusterCommand ,cmd_str :str = "" ):
126
- """Return the status of the executed command.By default the status is 0x0 unless a different
127
- status on InteractionModel is returned."""
125
+ async def _get_command_status (self ,cmd : ClusterCommand ,cmd_str :str = "" ):
126
+ """Return the status of the executed command. By default the status is 0x0 unless a different
127
+ status on InteractionModel is returned. For this test we consider the status 0x0 as not succesfull. """
128
128
cmd_status = Status .Success
129
129
if self .is_ci :
130
130
try :
@@ -133,9 +133,11 @@ async def get_command_status(self,cmd: ClusterCommand,cmd_str:str=""):
133
133
cmd_status = uc .status
134
134
else :
135
135
user_response = self .wait_for_user_input (prompt_msg = f"{ cmd_str } command is implemented in the DUT?. Enter 'y' or 'n' to confirm." ,
136
- prompt_msg_placeholder = "y" ,
137
- default_value = "y" )
136
+ default_value = "n" )
138
137
asserts .assert_equal (user_response .lower (), "n" )
138
+ if user_response .lower () == "n" :
139
+ cmd_status = Status .UnsupportedCommand
140
+
139
141
return cmd_status
140
142
141
143
@@ -144,8 +146,7 @@ def _ask_for_closed_door(self):
144
146
self ._send_close_door_commnad ()
145
147
sleep (1 )
146
148
else :
147
- user_response = self .wait_for_user_input (prompt_msg = f"Ensure that the door on the DUT is closed. Enter 'y' or 'n' after completition" ,
148
- prompt_msg_placeholder = "y" ,
149
+ user_response = self .wait_for_user_input (prompt_msg = f"Ensure that the door on the DUT is closed." ,
149
150
default_value = "y" )
150
151
asserts .assert_equal (user_response .lower (), "y" )
151
152
@@ -154,19 +155,18 @@ def _ask_for_open_door(self):
154
155
self ._send_open_door_command ()
155
156
else :
156
157
user_response = self .wait_for_user_input (prompt_msg = f"Manually open the door on the DUT. Enter 'y' or 'n' after completition" ,
157
- prompt_msg_placeholder = "y" ,
158
158
default_value = "y" )
159
159
asserts .assert_equal (user_response .lower (), "y" )
160
160
161
- async def read_refalm_state_attribute (self ):
161
+ async def _read_refalm_state_attribute (self ):
162
162
cluster = Clusters .Objects .RefrigeratorAlarm
163
163
return await self .read_single_attribute_check_success (
164
164
endpoint = self .endpoint ,
165
165
cluster = cluster ,
166
166
attribute = Clusters .RefrigeratorAlarm .Attributes .State
167
167
)
168
168
169
- def wait_thresshold (self ):
169
+ def _wait_thresshold (self ):
170
170
sleep (self .wait_thresshold_v / 1000 )
171
171
172
172
def _send_named_pipe_command (self , command_dict : dict [str , Any ]):
@@ -209,7 +209,7 @@ async def test_TC_REFALM_2_2(self):
209
209
210
210
self .step (3 )
211
211
# reads the state attribute , must be a bitMap32 ( list wich values are 32 bits)
212
- device_state = await self .read_refalm_state_attribute ()
212
+ device_state = await self ._read_refalm_state_attribute ()
213
213
logger .info (f"The device state is { device_state } " )
214
214
asserts .assert_equal (device_state ,0 )
215
215
@@ -220,11 +220,11 @@ async def test_TC_REFALM_2_2(self):
220
220
221
221
# wait PIXIT.REFALM.AlarmThreshold (5s)
222
222
self .step (5 )
223
- self .wait_thresshold ()
223
+ self ._wait_thresshold ()
224
224
225
225
# # read the status
226
226
self .step (6 )
227
- device_state = await self .read_refalm_state_attribute ()
227
+ device_state = await self ._read_refalm_state_attribute ()
228
228
logger .info (f"The device state is { device_state } " )
229
229
asserts .assert_equal (device_state ,1 )
230
230
@@ -234,16 +234,16 @@ async def test_TC_REFALM_2_2(self):
234
234
235
235
# # read from the state attr
236
236
self .step (8 )
237
- device_status = await self .read_refalm_state_attribute ()
237
+ device_status = await self ._read_refalm_state_attribute ()
238
238
logger .info (f"The device state is { device_state } " )
239
239
asserts .assert_equal (device_status ,0 )
240
240
241
241
self .step (9 )
242
- cmd_status = await self .get_command_status (cmd = FakeReset (),cmd_str = "Reset" )
242
+ cmd_status = await self ._get_command_status (cmd = FakeReset (),cmd_str = "Reset" )
243
243
asserts .assert_equal (Status .UnsupportedCommand ,cmd_status , msg = f"Command status is not { Status .UnsupportedCommand } , is { cmd_status } " )
244
244
245
245
self .step (10 )
246
- cmd_status = await self .get_command_status (cmd = FakeModifyEnabledAlarms (),cmd_str = "ModifyEnabledAlarms" )
246
+ cmd_status = await self ._get_command_status (cmd = FakeModifyEnabledAlarms (),cmd_str = "ModifyEnabledAlarms" )
247
247
asserts .assert_equal (Status .UnsupportedCommand ,cmd_status ,msg = f"Command status is not { Status .UnsupportedCommand } , is { cmd_status } " )
248
248
249
249
@@ -260,7 +260,7 @@ async def test_TC_REFALM_2_2(self):
260
260
self ._ask_for_open_door ()
261
261
262
262
self .step ("12.b" )
263
- self .wait_thresshold ()
263
+ self ._wait_thresshold ()
264
264
265
265
self .step ("12.c" )
266
266
# Wait for the Notify event with the State value.
0 commit comments