Skip to content

Commit 5524625

Browse files
cecillepull[bot]
authored andcommitted
TC-CGEN-2.4 - fix commented out test step (#25880)
* Fix step 19 * Fix indent
1 parent 28a0f5a commit 5524625

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/python_testing/TC_CGEN_2_4.py

+8-15
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import chip.CertificateAuthority
2222
import chip.clusters as Clusters
23+
import chip.clusters.enum
2324
import chip.FabricAdmin
2425
from chip import ChipDeviceCtrl
2526
from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main
@@ -106,21 +107,13 @@ async def test_TC_CGEN_2_4(self):
106107
elif cap == Clusters.GeneralCommissioning.Enums.RegulatoryLocationType.kOutdoor:
107108
newloc = Clusters.GeneralCommissioning.Enums.RegulatoryLocationType.kIndoor
108109
else:
109-
# TODO: figure out how to use the extender
110-
# newloc = MatterIntEnum.extend_enum_if_value_doesnt_exist(
111-
# Clusters.GeneralCommissioning.Enums.RegulatoryLocationType, 3)
112-
newloc = cap
113-
114-
_ = newloc
115-
116-
logging.info('Step 19 Send SetRgulatoryConfig with incorrect location')
117-
# cmd = Clusters.GeneralCommissioning.Commands.SetRegulatoryConfig(
118-
# newRegulatoryConfig=newloc, countryCode="XX", breadcrumb=0)
119-
# try:
120-
# await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=cmd)
121-
# except InteractionModelError as ex:
122-
# print("got the real error")
123-
# pass
110+
newloc = Clusters.GeneralCommissioning.Enums.RegulatoryLocationType.extend_enum_if_value_doesnt_exist(3)
111+
112+
logging.info('Step 19 Send SetRgulatoryConfig with incorrect location newloc = {}'.format(newloc))
113+
cmd = Clusters.GeneralCommissioning.Commands.SetRegulatoryConfig(
114+
newRegulatoryConfig=newloc, countryCode="XX", breadcrumb=0)
115+
ret = await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=cmd)
116+
asserts.assert_true(ret.errorCode, Clusters.GeneralCommissioning.Enums.CommissioningError.kValueOutsideRange)
124117

125118
logging.info('Step 20 - TH2 sends CommissioningComplete')
126119
cmd = Clusters.GeneralCommissioning.Commands.CommissioningComplete()

0 commit comments

Comments
 (0)