Skip to content

Commit 06c7306

Browse files
committed
Updating OPSTATECommon and RVCOPSTATE_2_1 modules:
- Updated to using attribute_guard function in place of attributes_guard.
1 parent d18eaa6 commit 06c7306

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

src/python_testing/TC_OpstateCommon.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ async def TEST_TC_OPSTATE_BASE_1_1(self, endpoint=1, cluster_revision=1, feature
248248
attributes.ClusterRevision.attribute_id
249249
]
250250

251-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
251+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
252252
expected_value.append(attributes.CountdownTime.attribute_id)
253253

254254
await self.read_and_expect_array_contains(endpoint=endpoint,
@@ -347,7 +347,7 @@ async def TEST_TC_OPSTATE_BASE_2_1(self, endpoint=1):
347347

348348
# STEP 2: TH reads from the DUT the PhaseList attribute
349349
self.step(2)
350-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.PhaseList):
350+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.PhaseList):
351351
phase_list = await self.read_expect_success(endpoint=endpoint,
352352
attribute=attributes.PhaseList)
353353
if phase_list is not NullValue:
@@ -357,7 +357,7 @@ async def TEST_TC_OPSTATE_BASE_2_1(self, endpoint=1):
357357

358358
# STEP 3: TH reads from the DUT the CurrentPhase attribute
359359
self.step(3)
360-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.CurrentPhase):
360+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.CurrentPhase):
361361
current_phase = await self.read_expect_success(endpoint=endpoint,
362362
attribute=attributes.CurrentPhase)
363363
if (phase_list == NullValue) or (not phase_list):
@@ -369,7 +369,7 @@ async def TEST_TC_OPSTATE_BASE_2_1(self, endpoint=1):
369369

370370
# STEP 4: TH reads from the DUT the CountdownTime attribute
371371
self.step(4)
372-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
372+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
373373
countdown_time = await self.read_expect_success(endpoint=endpoint,
374374
attribute=attributes.CountdownTime)
375375
if countdown_time is not NullValue:
@@ -378,7 +378,7 @@ async def TEST_TC_OPSTATE_BASE_2_1(self, endpoint=1):
378378

379379
# STEP 5: TH reads from the DUT the OperationalStateList attribute
380380
self.step(5)
381-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.OperationalStateList):
381+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.OperationalStateList):
382382
operational_state_list = await self.read_expect_success(endpoint=endpoint,
383383
attribute=attributes.OperationalStateList)
384384
defined_states = [state.value for state in cluster.Enums.OperationalStateEnum
@@ -464,7 +464,7 @@ async def TEST_TC_OPSTATE_BASE_2_1(self, endpoint=1):
464464

465465
# STEP 7: TH reads from the DUT the OperationalError attribute
466466
self.step(7)
467-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.OperationalError):
467+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.OperationalError):
468468
operational_error = await self.read_expect_success(endpoint=endpoint,
469469
attribute=attributes.OperationalError)
470470
# Defined Errors
@@ -600,7 +600,7 @@ async def TEST_TC_OPSTATE_BASE_2_2(self, endpoint=1):
600600

601601
# STEP 3: TH reads from the DUT the OperationalStateList attribute
602602
self.step(3)
603-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.OperationalStateList):
603+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.OperationalStateList):
604604
operational_state_list = await self.read_expect_success(endpoint=endpoint,
605605
attribute=attributes.OperationalStateList)
606606

@@ -628,15 +628,15 @@ async def TEST_TC_OPSTATE_BASE_2_2(self, endpoint=1):
628628

629629
# STEP 6: TH reads from the DUT the OperationalError attribute
630630
self.step(6)
631-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.OperationalError):
631+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.OperationalError):
632632
await self.read_and_expect_property_value(endpoint=endpoint,
633633
attribute=attributes.OperationalError,
634634
attr_property="errorStateID",
635635
expected_value=cluster.Enums.ErrorStateEnum.kNoError)
636636

637637
# STEP 7: TH reads from the DUT the CountdownTime attribute
638638
self.step(7)
639-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
639+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
640640
initial_countdown_time = await self.read_expect_success(endpoint=endpoint,
641641
attribute=attributes.CountdownTime)
642642
if initial_countdown_time is not NullValue:
@@ -645,7 +645,7 @@ async def TEST_TC_OPSTATE_BASE_2_2(self, endpoint=1):
645645

646646
# STEP 8: TH reads from the DUT the PhaseList attribute
647647
self.step(8)
648-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.PhaseList):
648+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.PhaseList):
649649
phase_list = await self.read_expect_success(endpoint=endpoint,
650650
attribute=attributes.PhaseList)
651651
phase_list_len = 0
@@ -656,7 +656,7 @@ async def TEST_TC_OPSTATE_BASE_2_2(self, endpoint=1):
656656

657657
# STEP 9: TH reads from the DUT the CurrentPhase attribute
658658
self.step(9)
659-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.CurrentPhase):
659+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.CurrentPhase):
660660
current_phase = await self.read_expect_success(endpoint=endpoint,
661661
attribute=attributes.CurrentPhase)
662662
if (phase_list == NullValue) or (not phase_list):
@@ -669,12 +669,12 @@ async def TEST_TC_OPSTATE_BASE_2_2(self, endpoint=1):
669669

670670
# STEP 10: TH waits for {PIXIT.WAITTIME.COUNTDOWN}
671671
self.step(10)
672-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
672+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
673673
time.sleep(wait_time)
674674

675675
# STEP 11: TH reads from the DUT the CountdownTime attribute
676676
self.step(11)
677-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
677+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
678678
countdown_time = await self.read_expect_success(endpoint=endpoint,
679679
attribute=attributes.CountdownTime)
680680

@@ -815,7 +815,7 @@ async def TEST_TC_OPSTATE_BASE_2_3(self, endpoint=1):
815815

816816
# STEP 6: TH reads from the DUT the CountdownTime attribute
817817
self.step(6)
818-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
818+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
819819
initial_countdown_time = await self.read_expect_success(endpoint=endpoint,
820820
attribute=attributes.CountdownTime)
821821
if initial_countdown_time is not NullValue:
@@ -829,7 +829,7 @@ async def TEST_TC_OPSTATE_BASE_2_3(self, endpoint=1):
829829

830830
# STEP 8: TH reads from the DUT the CountdownTime attribute
831831
self.step(8)
832-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
832+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
833833
countdown_time = await self.read_expect_success(endpoint=endpoint,
834834
attribute=attributes.CountdownTime)
835835

@@ -1061,7 +1061,7 @@ async def TEST_TC_OPSTATE_BASE_2_5(self, endpoint=1):
10611061

10621062
# STEP 5: TH reads from the DUT the CountdownTime attribute
10631063
self.step(5)
1064-
if await self.attributes_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
1064+
if await self.attribute_guard(endpoint=endpoint, attribute=attributes.CountdownTime):
10651065
initial_countdown_time = await self.read_expect_success(endpoint=endpoint,
10661066
attribute=attributes.CountdownTime)
10671067

src/python_testing/TC_RVCOPSTATE_2_1.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async def test_TC_RVCOPSTATE_2_1(self):
105105
if self.is_ci:
106106
self.write_to_app_pipe({"Name": "Reset"})
107107

108-
if await self.attributes_guard(endpoint=self.endpoint, attribute=attributes.PhaseList):
108+
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.PhaseList):
109109
self.print_step(2, "Read PhaseList attribute")
110110
phase_list = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.PhaseList)
111111

@@ -118,7 +118,7 @@ async def test_TC_RVCOPSTATE_2_1(self):
118118

119119
asserts.assert_less_equal(phase_list_len, 32, "PhaseList length(%d) must be less than 32!" % phase_list_len)
120120

121-
if await self.attributes_guard(endpoint=self.endpoint, attribute=attributes.CurrentPhase):
121+
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.CurrentPhase):
122122
self.print_step(3, "Read CurrentPhase attribute")
123123
current_phase = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CurrentPhase)
124124
logging.info("CurrentPhase: %s" % (current_phase))
@@ -129,7 +129,7 @@ async def test_TC_RVCOPSTATE_2_1(self):
129129
asserts.assert_true(0 <= current_phase < phase_list_len,
130130
"CurrentPhase(%s) must be between 0 and %d" % (current_phase, (phase_list_len - 1)))
131131

132-
if await self.attributes_guard(endpoint=self.endpoint, attribute=attributes.CountdownTime):
132+
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.CountdownTime):
133133
self.print_step(4, "Read CountdownTime attribute")
134134
countdown_time = await self.read_mod_attribute_expect_success(endpoint=self.endpoint,
135135
attribute=attributes.CountdownTime)
@@ -139,7 +139,7 @@ async def test_TC_RVCOPSTATE_2_1(self):
139139
asserts.assert_true(countdown_time >= 0 and countdown_time <= 259200,
140140
"CountdownTime(%s) must be between 0 and 259200" % countdown_time)
141141

142-
if await self.attributes_guard(endpoint=self.endpoint, attribute=attributes.OperationalStateList):
142+
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.OperationalStateList):
143143
self.print_step(5, "Read OperationalStateList attribute")
144144
operational_state_list = await self.read_mod_attribute_expect_success(endpoint=self.endpoint,
145145
attribute=attributes.OperationalStateList)
@@ -162,7 +162,7 @@ async def test_TC_RVCOPSTATE_2_1(self):
162162

163163
asserts.assert_true(error_state_present, "The OperationalStateList does not have an ID entry of Error(0x03)")
164164

165-
if await self.attributes_guard(endpoint=self.endpoint, attribute=attributes.OperationalState):
165+
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.OperationalState):
166166
self.print_step(6, "Read OperationalState attribute")
167167
operational_state = await self.read_mod_attribute_expect_success(endpoint=self.endpoint,
168168
attribute=attributes.OperationalState)
@@ -229,7 +229,7 @@ async def test_TC_RVCOPSTATE_2_1(self):
229229
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
230230
await self.read_and_validate_opstate(step="6n", expected_state=Clusters.RvcOperationalState.Enums.OperationalStateEnum.kDocked)
231231

232-
if await self.attributes_guard(endpoint=self.endpoint, attribute=attributes.OperationalError):
232+
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.OperationalError):
233233
self.print_step(7, "Read OperationalError attribute")
234234
operational_error = await self.read_mod_attribute_expect_success(endpoint=self.endpoint,
235235
attribute=attributes.OperationalError)

0 commit comments

Comments
 (0)