Skip to content

Commit

Permalink
Restyled by autopep8
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and j-ororke committed Nov 15, 2024
1 parent 5c94500 commit bd8c021
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/controller/python/chip/ChipDeviceCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ async def __aexit__(self, exc_type, exc_value, traceback):
self._future = None
self._lock.release()


class CommissioningContext(CallbackContext):
"""A context manager for handling commissioning callbacks that are expected to be called exactly once.
Expand Down Expand Up @@ -1936,7 +1937,7 @@ def _InitLib(self):
#self._dmLib.pychip_GetCommissioningRCACData.restype = None
self._dmLib.pychip_SetCommissioningRCACCallback.argtypes = [_RCACCallbackType]
self._dmLib.pychip_SetCommissioningRCACCallback.restype = None

self._dmLib.pychip_DeviceController_IssueNOCChain.argtypes = [
c_void_p, py_object, c_char_p, c_size_t, c_uint64]
self._dmLib.pychip_DeviceController_IssueNOCChain.restype = PyChipError
Expand Down Expand Up @@ -2226,8 +2227,8 @@ async def CommissionOnNetwork(self, nodeId: int, setupPinCode: int,
rcac_data = bytes(ctypes.cast(rcac_data, ctypes.POINTER(ctypes.c_ubyte * rcac_size)).contents)

except Exception as e:
LOGGER.exception(f"Error when attempting to get rcac data and size after commissioning: {e}")
return
LOGGER.exception(f"Error when attempting to get rcac data and size after commissioning: {e}")
return

if rcac_size > 0:
return (await asyncio.futures.wrap_future(ctx.future), rcac_data)
Expand Down
5 changes: 3 additions & 2 deletions src/python_testing/TC_CADMIN_1_3_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ async def test_TC_CADMIN_1_3(self):

# Verify that the RootPublicKey matches the root public key for TH_CR2 and the NodeID matches the node ID used when TH_CR2 commissioned the device.
await self.send_single_cmd(dev_ctrl=self.th2, node_id=self.dut_node_id, cmd=Clusters.GeneralCommissioning.Commands.ArmFailSafe(10))
#th2_cam_rcac = TLVReader(base64.b64decode(
# th2_cam_rcac = TLVReader(base64.b64decode(
# self.certificate_authority_manager.activeCaList[1]._persistentStorage._jsonData["sdk-config"]["f/2/r"])).get()["Any"][9]

if th2_fabric_info[0].rootPublicKey != th2_rcac_decoded:
asserts.fail("public keys from fabric and certs for TH1 are not the same")
if th2_fabric_info[0].nodeID != self.dut_node_id:
Expand Down Expand Up @@ -368,5 +368,6 @@ async def test_TC_CADMIN_1_4(self):
removeFabricCmd = Clusters.OperationalCredentials.Commands.RemoveFabric(th2_idx[outer_key][inner_key][attribute_key])
await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=removeFabricCmd)


if __name__ == "__main__":
default_matter_test_main()

0 comments on commit bd8c021

Please sign in to comment.