Skip to content

Commit

Permalink
TC-CGEN-2.4 - fix commented out test step (#25880)
Browse files Browse the repository at this point in the history
* Fix step 19

* Fix indent
  • Loading branch information
cecille authored and pull[bot] committed Sep 14, 2023
1 parent 13dc1de commit 9967950
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions src/python_testing/TC_CGEN_2_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import chip.CertificateAuthority
import chip.clusters as Clusters
import chip.clusters.enum
import chip.FabricAdmin
from chip import ChipDeviceCtrl
from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main
Expand Down Expand Up @@ -106,21 +107,13 @@ async def test_TC_CGEN_2_4(self):
elif cap == Clusters.GeneralCommissioning.Enums.RegulatoryLocationType.kOutdoor:
newloc = Clusters.GeneralCommissioning.Enums.RegulatoryLocationType.kIndoor
else:
# TODO: figure out how to use the extender
# newloc = MatterIntEnum.extend_enum_if_value_doesnt_exist(
# Clusters.GeneralCommissioning.Enums.RegulatoryLocationType, 3)
newloc = cap

_ = newloc

logging.info('Step 19 Send SetRgulatoryConfig with incorrect location')
# cmd = Clusters.GeneralCommissioning.Commands.SetRegulatoryConfig(
# newRegulatoryConfig=newloc, countryCode="XX", breadcrumb=0)
# try:
# await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=cmd)
# except InteractionModelError as ex:
# print("got the real error")
# pass
newloc = Clusters.GeneralCommissioning.Enums.RegulatoryLocationType.extend_enum_if_value_doesnt_exist(3)

logging.info('Step 19 Send SetRgulatoryConfig with incorrect location newloc = {}'.format(newloc))
cmd = Clusters.GeneralCommissioning.Commands.SetRegulatoryConfig(
newRegulatoryConfig=newloc, countryCode="XX", breadcrumb=0)
ret = await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=cmd)
asserts.assert_true(ret.errorCode, Clusters.GeneralCommissioning.Enums.CommissioningError.kValueOutsideRange)

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

0 comments on commit 9967950

Please sign in to comment.