From daa5d774fed9162a9b4545f8cde7cece02f2bbc4 Mon Sep 17 00:00:00 2001 From: LUCAS BECKER Date: Sun, 11 Feb 2024 22:35:45 -0300 Subject: [PATCH] fix lint --- src/python_testing/TC_OVENOPSTATE_2_3.py | 128 +---------------------- 1 file changed, 2 insertions(+), 126 deletions(-) diff --git a/src/python_testing/TC_OVENOPSTATE_2_3.py b/src/python_testing/TC_OVENOPSTATE_2_3.py index dbdee8edc66145..d7fbc848630240 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_3.py +++ b/src/python_testing/TC_OVENOPSTATE_2_3.py @@ -15,13 +15,12 @@ # limitations under the License. # -import logging import chip.clusters as Clusters from matter_testing_support import TestStep, MatterBaseTest, async_test_body, default_matter_test_main -from mobly import asserts from TC_OpstateCommon import TC_OVENOPSTATE_BASE, TestInfo + class TC_OVENOPSTATE_2_3(MatterBaseTest, TC_OVENOPSTATE_BASE): def __init__(self, *args): super().__init__(*args) @@ -45,130 +44,7 @@ async def test_TC_OVENOPSTATE_2_3(self): await self.TEST_TC_OPSTATE_BASE_2_3(endpoint=endpoint) - # async def read_mod_attribute_expect_success(self, endpoint, attribute): - # cluster = Clusters.Objects.OvenCavityOperationalState - # return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) - - # async def send_pause_cmd(self) -> Clusters.Objects.OvenCavityOperationalState.Commands.Pause: - # ret = await self.send_single_cmd(cmd=Clusters.Objects.OvenCavityOperationalState.Commands.Pause(), endpoint=self.endpoint) - # asserts.assert_true(type_matches(ret, Clusters.Objects.OvenCavityOperationalState.Commands.OperationalCommandResponse), - # "Unexpected return type for Pause") - # return ret - - # async def send_resume_cmd(self) -> Clusters.Objects.OvenCavityOperationalState.Commands.Resume: - # ret = await self.send_single_cmd(cmd=Clusters.Objects.OvenCavityOperationalState.Commands.Resume(), endpoint=self.endpoint) - # asserts.assert_true(type_matches(ret, Clusters.Objects.OvenCavityOperationalState.Commands.OperationalCommandResponse), - # "Unexpected return type for Resume") - # return ret - - # @async_test_body - # async def test_TC_OVENOPSTATE_2_3(self): - - # asserts.assert_true('PIXIT_ENDPOINT' in self.matter_test_config.global_test_params, - # "PIXIT_ENDPOINT must be included on the command line in " - # "the --int-arg flag as PIXIT_ENDPOINT:") - - # self.endpoint = self.matter_test_config.global_test_params['PIXIT_ENDPOINT'] - - # asserts.assert_true(self.check_pics("OVENOPSTATE.S.A0003"), "OVENOPSTATE.S.A0003 must be supported") - # asserts.assert_true(self.check_pics("OVENOPSTATE.S.A0004"), "OVENOPSTATE.S.A0004 must be supported") - # asserts.assert_true(self.check_pics("OVENOPSTATE.S.C00.Rsp"), "OVENOPSTATE.S.C00.Rsp must be supported") - # asserts.assert_true(self.check_pics("OVENOPSTATE.S.C03.Rsp"), "OVENOPSTATE.S.C03.Rsp must be supported") - - # attributes = Clusters.OvenCavityOperationalState.Attributes - - # self.print_step(1, "Commissioning, already done") - - # self.print_step(2, "Manually put the device in a state where it can receive a Pause command") - # input("Press Enter when done.\n") - - # self.print_step(3, "Read OperationalStateList attribute") - # op_state_list = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, - # attribute=attributes.OperationalStateList) - - # logging.info("OperationalStateList: %s" % (op_state_list)) - - # defined_states = [state.value for state in Clusters.OvenCavityOperationalState.Enums.OperationalStateEnum - # if state is not Clusters.OvenCavityOperationalState.Enums.OperationalStateEnum.kUnknownEnumValue] - - # state_ids = set([s.operationalStateID for s in op_state_list]) - - # asserts.assert_true(all(id in state_ids for id in defined_states), - # "OperationalStateList is missing a required entry") - - # self.print_step(4, "Send Pause command") - # ret = await self.send_pause_cmd() - # asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OvenCavityOperationalState.Enums.ErrorStateEnum.kNoError, - # "errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID) - - # self.print_step(5, "Read OperationalState attribute") - # operational_state = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, - # attribute=attributes.OperationalState) - # logging.info("OperationalState: %s" % (operational_state)) - # asserts.assert_equal(operational_state, Clusters.OvenCavityOperationalState.Enums.OperationalStateEnum.kPaused, - # "OperationalState ID should be Paused(0x02)") - - # if self.check_pics("OVENOPSTATE.S.A0002"): - # self.print_step(6, "Read CountdownTime attribute") - # initial_countdown_time = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, - # attribute=attributes.CountdownTime) - # logging.info("CountdownTime: %s" % (initial_countdown_time)) - # if initial_countdown_time is not NullValue: - # in_range = (1 <= initial_countdown_time <= 259200) - # asserts.assert_true(initial_countdown_time is NullValue or in_range, - # "invalid CountdownTime(%s). Must be in between 1 and 259200, or null " % initial_countdown_time) - - # self.print_step(7, "Waiting for 5 seconds") - # time.sleep(5) - - # self.print_step(8, "Read CountdownTime attribute") - # countdown_time = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CountdownTime) - # logging.info("CountdownTime: %s" % (countdown_time)) - # asserts.assert_true(countdown_time != 0 or countdown_time == NullValue, - # "invalid CountdownTime(%s). Must be a non zero integer, or null" % countdown_time) - # asserts.assert_equal(countdown_time, initial_countdown_time, "CountdownTime(%s) does not equal to the intial CountdownTime(%s)" - # % (countdown_time, initial_countdown_time)) - - # self.print_step(9, "Send Pause command") - # ret = await self.send_pause_cmd() - # asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OvenCavityOperationalState.Enums.ErrorStateEnum.kNoError, - # "errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID) - - # self.print_step(10, "Send Resume command") - # ret = await self.send_resume_cmd() - # asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OvenCavityOperationalState.Enums.ErrorStateEnum.kNoError, - # "errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID) - - # self.print_step(11, "Read OperationalState attribute") - # operational_state = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, - # attribute=attributes.OperationalState) - # logging.info("OperationalState: %s" % (operational_state)) - # asserts.assert_equal(operational_state, Clusters.OvenCavityOperationalState.Enums.OperationalStateEnum.kRunning, - # "OperationalState(%s) should be Running(0x01)" % operational_state) - - # self.print_step(12, "Send Resume command") - # ret = await self.send_resume_cmd() - # asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OvenCavityOperationalState.Enums.ErrorStateEnum.kNoError, - # "errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID) - - # self.print_step(13, "Manually put the device in a state where it cannot receive a Pause command") - # input("Press Enter when done.\n") - - # self.print_step(14, "Send Pause command") - # ret = await self.send_pause_cmd() - # asserts.assert_equal(ret.commandResponseState.errorStateID, - # Clusters.OvenCavityOperationalState.Enums.ErrorStateEnum.kCommandInvalidInState, - # "errorStateID(%s) should be CommandInvalidInState(0x03)" % ret.commandResponseState.errorStateID) - - # self.print_step(15, "Manually put the device in a state where it cannot receive a Resume command") - # input("Press Enter when done.\n") - - # self.print_step(16, "Send Resume command") - # ret = await self.send_resume_cmd() - # asserts.assert_equal(ret.commandResponseState.errorStateID, - # Clusters.OvenCavityOperationalState.Enums.ErrorStateEnum.kCommandInvalidInState, - # "errorStateID(%s) should be CommandInvalidInState(0x03)" % ret.commandResponseState.errorStateID) - if __name__ == "__main__": default_matter_test_main() +