Skip to content

Commit

Permalink
Updating TC_CADMIN_1_9 test module due to issues noticed during step 4 (
Browse files Browse the repository at this point in the history
project-chip#36546)

* Updating TC_CADMIN_1_9 test module:
- Replacing wait with using 3 and 50 as error codes possible when attempting to commission on the 21st attempt!

* Restyled by autopep8

* Updating TC_CADMIN_1_9 test module:
- Attempting to resolve linting error for bare except

* Updating TC_CADMIN_1_9 test module:
- Attempting to resolve linting errors

* Updating CADMIN_1_9 test module:
- Replaced exception to using asserts.assert_in() function instead, much cleaner!

---------

Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
j-ororke and restyled-commits authored Nov 29, 2024
1 parent fb24b90 commit 99e1006
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/python_testing/TC_CADMIN_1_9.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ async def CommissionAttempt(
errcode = await self.CommissionOnNetwork(setupPinCode)
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 == expectedErrCode, 'Unexpected error code returned from CommissioningComplete')
# TODO: Adding try or except clause here as the errcode code be either 50 for timeout or 3 for incorrect state at this time
# until issue mentioned in https://github.com/project-chip/connectedhomeip/issues/34383 can be resolved
asserts.assert_in(errcode.sdk_code, [expectedErrCode, 3], 'Unexpected error code returned from CommissioningComplete')

def pics_TC_CADMIN_1_9(self) -> list[str]:
return ["CADMIN.S"]
Expand All @@ -127,9 +129,6 @@ async def test_TC_CADMIN_1_9(self):

self.step(3)
await self.CommissionAttempt(setupPinCode, expectedErrCode=0x03)
# TODO: Found if we don't add sleep time after test completes that we get unexpected error code and response after the 21st iteration.
# Link to Bug Filed: https://github.com/project-chip/connectedhomeip/issues/34383
sleep(1)

self.step(4)
await self.CommissionAttempt(setupPinCode, expectedErrCode=0x32)
Expand Down

0 comments on commit 99e1006

Please sign in to comment.