|
20 | 20 |
|
21 | 21 | import chip.CertificateAuthority
|
22 | 22 | import chip.clusters as Clusters
|
| 23 | +import chip.clusters.enum |
23 | 24 | import chip.FabricAdmin
|
24 | 25 | from chip import ChipDeviceCtrl
|
25 | 26 | 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):
|
106 | 107 | elif cap == Clusters.GeneralCommissioning.Enums.RegulatoryLocationType.kOutdoor:
|
107 | 108 | newloc = Clusters.GeneralCommissioning.Enums.RegulatoryLocationType.kIndoor
|
108 | 109 | 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) |
124 | 117 |
|
125 | 118 | logging.info('Step 20 - TH2 sends CommissioningComplete')
|
126 | 119 | cmd = Clusters.GeneralCommissioning.Commands.CommissioningComplete()
|
|
0 commit comments