@@ -52,7 +52,7 @@ async def read_supported_areas(self, step):
52
52
self .print_step (step , "Read SupportedAreas attribute" )
53
53
supported_areas = await self .read_sear_attribute_expect_success (
54
54
endpoint = self .endpoint , attribute = Clusters .ServiceArea .Attributes .SupportedAreas )
55
- logging .info ("SupportedAreas: %s" % ( supported_areas ) )
55
+ logging .info ("SupportedAreas: %s" % supported_areas )
56
56
57
57
return [a .areaID for a in supported_areas ]
58
58
@@ -77,7 +77,7 @@ def write_to_app_pipe(self, command):
77
77
with open (self .app_pipe , "w" ) as app_pipe :
78
78
app_pipe .write (command + "\n " )
79
79
# Allow some time for the command to take effect.
80
- # This removes the test flakyness which is very annoying for everyone in CI.
80
+ # This removes the test flakiness which is very annoying for everyone in CI.
81
81
sleep (0.001 )
82
82
83
83
def TC_SEAR_1_6 (self ) -> list [str ]:
@@ -102,7 +102,10 @@ async def test_TC_SEAR_1_6(self):
102
102
103
103
test_step = "Manually intervene to put the device in the idle state and ensure SupportedAreas and SelectedAreas are not empty"
104
104
self .print_step ("2" , test_step )
105
- if not self .is_ci :
105
+ if self .is_ci :
106
+ await self .send_single_cmd (cmd = Clusters .Objects .ServiceArea .Commands .SelectAreas (newAreas = [7 , 1234567 ]),
107
+ endpoint = self .endpoint )
108
+ else :
106
109
self .wait_for_user_input (prompt_msg = f"{ test_step } , and press Enter when done.\n " )
107
110
108
111
supported_area_ids = await self .read_supported_areas (step = 3 )
@@ -113,7 +116,10 @@ async def test_TC_SEAR_1_6(self):
113
116
114
117
test_step = "Manually intervene to put the device in the operating state"
115
118
self .print_step ("5" , test_step )
116
- if not self .is_ci :
119
+ if self .is_ci :
120
+ await self .send_single_cmd (cmd = Clusters .Objects .RvcRunMode .Commands .ChangeToMode (newMode = 1 ),
121
+ endpoint = self .endpoint )
122
+ else :
117
123
self .wait_for_user_input (prompt_msg = f"{ test_step } , and press Enter when done.\n " )
118
124
119
125
progress_list_operating = await self .read_progress (step = 6 )
@@ -122,16 +128,20 @@ async def test_TC_SEAR_1_6(self):
122
128
123
129
for p in progress_list_operating :
124
130
asserts .assert_true (p .areaID in selected_areas , f"Progress entry with unknown AreaID({ p .areaID } )" )
125
- asserts .assert_true (p .status in (Clusters .ServiceArea .OperationalStatusEnum .kPending ,
126
- Clusters .ServiceArea .OperationalStatusEnum .kOperating ),
131
+ asserts .assert_true (p .status in (Clusters .ServiceArea .Enums . OperationalStatusEnum .kPending ,
132
+ Clusters .ServiceArea .Enums . OperationalStatusEnum .kOperating ),
127
133
f"Progress entry with unexpected Status({ p .status } )" )
128
- asserts .assert_true (p .TotalOperationalTime is NullValue , "Progress entry with non-null TotalOperationalTime" )
134
+ asserts .assert_true (type (p .totalOperationalTime ) in [type (None ), type (
135
+ NullValue )], "Progress.TotalOperationalTime has a value" )
129
136
130
137
test_step = "While all entries in Progress show the Pending or Operating status (i.e. \
131
138
before any area is skipped or completed), manually intervene to put the device \
132
139
in the idle state, by ending the operation unexpectedly (e.g. force an error)"
133
140
self .print_step ("7" , test_step )
134
- if not self .is_ci :
141
+ if self .is_ci :
142
+ await self .send_single_cmd (cmd = Clusters .Objects .RvcRunMode .Commands .ChangeToMode (newMode = 0 ),
143
+ endpoint = self .endpoint )
144
+ else :
135
145
self .wait_for_user_input (prompt_msg = f"{ test_step } , and press Enter when done.\n " )
136
146
137
147
progress_list_idle = await self .read_progress (step = 8 )
@@ -140,7 +150,7 @@ async def test_TC_SEAR_1_6(self):
140
150
141
151
for p in progress_list_idle :
142
152
asserts .assert_true (p .areaID in selected_areas , f"Progress entry with unknown AreaID({ p .areaID } )" )
143
- asserts .assert_true (p .status == Clusters .ServiceArea .OperationalStatusEnum .kSkipped ,
153
+ asserts .assert_true (p .status == Clusters .ServiceArea .Enums . OperationalStatusEnum .kSkipped ,
144
154
f"Progress entry with unexpected Status({ p .status } )" )
145
155
146
156
0 commit comments