Skip to content

Commit

Permalink
updated checks by LInt
Browse files Browse the repository at this point in the history
  • Loading branch information
sumaky committed Aug 21, 2024
1 parent e517bd6 commit d59d3c5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/python_testing/TC_DRLK_2_9.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
# === END CI TEST ARGUMENTS ===

import logging
import random
from dataclasses import dataclass

import chip.clusters as Clusters
from chip.clusters.Attribute import EventPriority
from chip.clusters.Types import NullValue
from chip.interaction_model import InteractionModelError, Status
from drlk_2_x_common import DRLK_COMMON
Expand Down Expand Up @@ -197,7 +193,7 @@ async def get_credentials_status(self, credentialIndex: int, credentialType: clu
asserts.assert_true(response.credentialExists == credential_exists,
"Error when executing GetCredentialStatus command, credentialExists={}".format(
str(response.credentialExists)))
if (credential_exists == False):
if (not credential_exists):
asserts.assert_true(response.userIndex == NullValue,
"Error when executing GetCredentialStatus command, credentialExists={}".format(
str(response.userIndex)))
Expand Down Expand Up @@ -402,9 +398,6 @@ async def test_TC_DRLK_2_9(self):

self.step("11")
if self.pics_send_setcredential_pin_cmd:
validPincodeString = await self.generate_pincode(self.maxpincodelength)
validPincode = bytes(validPincodeString, 'ascii')

await self.set_credential_cmd(credentialData=self.pin_code,
operationType=cluster.Enums.DataOperationTypeEnum.kAdd,
credential_enum=Clusters.Objects.DoorLock.Enums.CredentialTypeEnum.kPin,
Expand All @@ -424,8 +417,8 @@ async def test_TC_DRLK_2_9(self):
feature_map = await self.read_attributes_from_dut(endpoint=self.app_cluster_endpoint,
cluster=Clusters.Objects.DoorLock,
attribute=Clusters.DoorLock.Attributes.FeatureMap)
isALIROSupported = feature_map & Clusters.DoorLock.Bitmaps.Feature.kAliroProvisioning
if (isALIROSupported):
aliro_enabled = feature_map & Clusters.DoorLock.Bitmaps.Feature.kAliroProvisioning
if (aliro_enabled):
credentials = cluster.Structs.CredentialStruct(credentialIndex=1,
credentialType=cluster.Enums.CredentialTypeEnum.kAliroNonEvictableEndpointKey)
await self.clear_credentials_cmd(step=None, credential=credentials)
Expand Down

0 comments on commit d59d3c5

Please sign in to comment.