Skip to content

Commit

Permalink
Fixed Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
beckerzito committed Feb 12, 2024
1 parent 7fcbf8f commit 530390b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/python_testing/TC_OVENOPSTATE_1_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import chip.clusters as Clusters
from matter_testing_support import TestStep, MatterBaseTest, async_test_body, default_matter_test_main
from TC_OpstateCommon import TC_OVENOPSTATE_BASE, TestInfo
from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo


class TC_OVENOPSTATE_1_1(MatterBaseTest, TC_OVENOPSTATE_BASE):
class TC_OVENOPSTATE_1_1(MatterBaseTest, TC_OPSTATE_BASE):
def __init__(self, *args):
super().__init__(*args)

Expand Down
4 changes: 2 additions & 2 deletions src/python_testing/TC_OVENOPSTATE_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import chip.clusters as Clusters
from matter_testing_support import TestStep, MatterBaseTest, async_test_body, default_matter_test_main
from TC_OpstateCommon import TC_OVENOPSTATE_BASE, TestInfo
from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo


class TC_OVENOPSTATE_2_1(MatterBaseTest, TC_OVENOPSTATE_BASE):
class TC_OVENOPSTATE_2_1(MatterBaseTest, TC_OPSTATE_BASE):
def __init__(self, *args):
super().__init__(*args)

Expand Down
4 changes: 2 additions & 2 deletions src/python_testing/TC_OVENOPSTATE_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import chip.clusters as Clusters
from matter_testing_support import TestStep, MatterBaseTest, async_test_body, default_matter_test_main
from TC_OpstateCommon import TC_OVENOPSTATE_BASE, TestInfo
from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo


class TC_OVENOPSTATE_2_2(MatterBaseTest, TC_OVENOPSTATE_BASE):
class TC_OVENOPSTATE_2_2(MatterBaseTest, TC_OPSTATE_BASE):

def __init__(self, *args):
super().__init__(*args)
Expand Down
4 changes: 2 additions & 2 deletions src/python_testing/TC_OVENOPSTATE_2_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import chip.clusters as Clusters
from matter_testing_support import TestStep, MatterBaseTest, async_test_body, default_matter_test_main
from TC_OpstateCommon import TC_OVENOPSTATE_BASE, TestInfo
from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo


class TC_OVENOPSTATE_2_3(MatterBaseTest, TC_OVENOPSTATE_BASE):
class TC_OVENOPSTATE_2_3(MatterBaseTest, TC_OPSTATE_BASE):
def __init__(self, *args):
super().__init__(*args)

Expand Down
4 changes: 2 additions & 2 deletions src/python_testing/TC_OVENOPSTATE_2_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import chip.clusters as Clusters
from matter_testing_support import TestStep, MatterBaseTest, async_test_body, default_matter_test_main
from TC_OpstateCommon import TC_OVENOPSTATE_BASE, TestInfo
from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo


class TC_OVENOPSTATE_2_4(MatterBaseTest, TC_OVENOPSTATE_BASE):
class TC_OVENOPSTATE_2_4(MatterBaseTest, TC_OPSTATE_BASE):
def __init__(self, *args):
super().__init__(*args)

Expand Down
23 changes: 11 additions & 12 deletions src/python_testing/TC_OpstateCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class TestInfo:
cluster: Clusters


class TC_OVENOPSTATE_BASE():
class TC_OPSTATE_BASE():
def setup_base(self, test_info=None, app_pipe="/tmp/chip_all_clusters_fifo_"):

asserts.assert_true(test_info is not None,
Expand Down Expand Up @@ -224,18 +224,18 @@ async def TEST_TC_OPSTATE_BASE_1_1(self, endpoint=1, cluster_revision=1, feature

if (self.check_pics(("%s.S.C00.Rsp" % self.test_info.pics_code)) or
self.check_pics(("%s.S.C03.Rsp" % self.test_info.pics_code))):
expected_value.append(commands.Pause.command_id)
expected_value.append(commands.Pause.command_id)

if (self.check_pics(("%s.S.C01.Rsp" % self.test_info.pics_code)) or \
if (self.check_pics(("%s.S.C01.Rsp" % self.test_info.pics_code)) or
self.check_pics(("%s.S.C02.Rsp" % self.test_info.pics_code))):
expected_value.append(commands.Stop.command_id)
expected_value.append(commands.Stop.command_id)

if self.check_pics(("%s.S.C02.Rsp" % self.test_info.pics_code)):
expected_value.append(commands.Start.command_id)

if (self.check_pics(("%s.S.C03.Rsp" % self.test_info.pics_code)) or
self.check_pics(("%s.S.C00.Rsp" % self.test_info.pics_code))):
expected_value.append(commands.Resume.command_id)
expected_value.append(commands.Resume.command_id)

await self.read_and_expect_array_contains(endpoint=endpoint,
attribute=attributes.AcceptedCommandList,
Expand All @@ -249,7 +249,7 @@ async def TEST_TC_OPSTATE_BASE_1_1(self, endpoint=1, cluster_revision=1, feature
self.check_pics(("%s.S.C01.Rsp" % self.test_info.pics_code)) or
self.check_pics(("%s.S.C02.Rsp" % self.test_info.pics_code)) or
self.check_pics(("%s.S.C03.Rsp" % self.test_info.pics_code))):
expected_value.append(commands.OperationalCommandResponse.command_id)
expected_value.append(commands.OperationalCommandResponse.command_id)

await self.read_and_expect_array_contains(endpoint=endpoint,
attribute=attributes.GeneratedCommandList,
Expand Down Expand Up @@ -846,7 +846,6 @@ async def TEST_TC_OPSTATE_BASE_2_4(self, endpoint=1):
cluster = self.test_info.cluster
attributes = cluster.Attributes
events = cluster.Events
commands = cluster.Commands

self.init_test()

Expand All @@ -873,12 +872,12 @@ async def TEST_TC_OPSTATE_BASE_2_4(self, endpoint=1):
# STEP 3: At the DUT take the vendor defined action to generate an OperationalError event
self.step(3)
self.send_manual_or_pipe_command('{"Name":"OperationalStateChange", "Device":"%s", "Operation":"OnFault", "Param": 1}' % self.device)
event_data = events_callback.wait_for_event_report(cluster.Events.OperationalError).errorState
event_data = events_callback.wait_for_event_report(events.OperationalError).errorState

# Defined Errors
defined_errors = [error.value for error in cluster.Enums.ErrorStateEnum
if (error is not cluster.Enums.ErrorStateEnum.kUnknownEnumValue or
error is not cluster.Enums.ErrorStateEnum.kNoError)]
if (error is not cluster.Enums.ErrorStateEnum.kUnknownEnumValue or
error is not cluster.Enums.ErrorStateEnum.kNoError)]

in_range = (0x80 <= event_data.errorStateID <= 0xBF)
asserts.assert_true(event_data.errorStateID in defined_errors
Expand All @@ -890,8 +889,8 @@ async def TEST_TC_OPSTATE_BASE_2_4(self, endpoint=1):
self.step(4)
if self.pics_guard(self.check_pics("%s.S.A0004" % self.test_info.pics_code)):
await self.read_and_expect_value(endpoint=endpoint,
attribute=attributes.OperationalState,
expected_value=cluster.Enums.OperationalStateEnum.kError)
attribute=attributes.OperationalState,
expected_value=cluster.Enums.OperationalStateEnum.kError)
else:
self.skip_step(2)
self.skip_step(3)
Expand Down

0 comments on commit 530390b

Please sign in to comment.