Skip to content

Commit

Permalink
Update TC_CADMIN_1_19 test module:
Browse files Browse the repository at this point in the history
- Resolving linting issues
  • Loading branch information
j-ororke committed Sep 23, 2024
1 parent 671108e commit 1630220
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/python_testing/TC_CADMIN_1_19.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import logging
import random
from time import sleep

import chip.clusters as Clusters
from chip import ChipDeviceCtrl
Expand Down Expand Up @@ -57,21 +56,21 @@ async def CommissionAttempt(
self, setupPinCode: int, thnum: int, th: str, fail: bool):

logging.info(f"-----------------Commissioning with TH_CR{str(thnum)}-------------------------")
if fail == True:
if fail:
ctx = asserts.assert_raises(ChipStackError)
self.print_step(0, ctx)
with ctx:
await th.CommissionOnNetwork(
nodeId=self.dut_node_id, setupPinCode=setup_code,
nodeId=self.dut_node_id, setupPinCode=setupPinCode,
filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator)
errcode = PyChipError.from_code(ctx.exception.err)
logging.info('Commissioning complete done. Successful? {}, errorcode = {}, cycle={}'.format(
errcode.is_success, errcode, (cycle+1)))
logging.info('Commissioning complete done. Successful? {}, errorcode = {}'.format(
errcode.is_success, errcode))
asserts.assert_false(errcode.is_success, 'Commissioning complete did not error as expected')
asserts.assert_true(errcode.sdk_code == 0x0000000B,
'Unexpected error code returned from CommissioningComplete')

elif fail == False:
elif not fail:
await th.CommissionOnNetwork(
nodeId=self.dut_node_id, setupPinCode=setupPinCode,
filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator)
Expand Down

0 comments on commit 1630220

Please sign in to comment.