From 9f10e00d18e6cab7f1d045333d709d7d79b0da0f Mon Sep 17 00:00:00 2001 From: Moises Terrones Date: Wed, 4 Dec 2024 10:46:16 -0600 Subject: [PATCH 01/12] Create initial test draft for WasherCtrl --- src/python_testing/TC_WASHERCTRL_2_1.py | 129 ++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 src/python_testing/TC_WASHERCTRL_2_1.py diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py new file mode 100644 index 00000000000000..18de4f22b0790c --- /dev/null +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -0,0 +1,129 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true +# === END CI TEST ARGUMENTS === + +import logging +import random + +import chip.clusters as Clusters +from chip.interaction_model import Status +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + +logger = logging.getLogger(__name__) + + +MAX_SPIN_SPEEDS = 16 + + +class TC_WASHERCTRL_2_1(MatterBaseTest): + + def desc_TC_WASHERCTRL_2_1(self) -> str: + """Returns a description of this test""" + return "[TC-WASHERCTRL-2.1] Optional Spin attributes with DUT as Server" + + def pics_TC_WASHERCTRL_2_1(self) -> list[str]: + pics = [ + "WASHERCTRL.S.F00", + ] + return pics + + def steps_TC_WASHERCTRL_2_1(self) -> list[TestStep]: + steps = [ + TestStep(1, "Commissioning, already done", + is_commissioning=True), + TestStep(2, "TH reads from the DUT the SpinSpeeds attribute"), + TestStep(3, "TH reads from the DUT the SpinSpeedCurrent attribute"), + TestStep(4, "TH writes a supported SpinSpeedCurrent attribute that is a valid index into the list" + + "of spin speeds (0 to numSpinSpeeds - 1)"), + TestStep(5, "After a few seconds, TH reads from the DUT the SpinSpeedCurrent attribute"), + TestStep(6, "TH writes an unsupported SpinSpeedCurrent attribute that is other than 0 to DUT") + ] + + return steps + + @async_test_body + async def test_TC_WASHERCTRL_2_1(self): + + endpoint = self.get_endpoint(default=1) + + self.step(1) + + # Read the SpinSpeeds attributes + self.step(2) + logger.info("Doing Step 2") + list_speed_speeds = await self.read_single_attribute_check_success(endpoint=endpoint, + cluster=Clusters.Objects.LaundryWasherControls, + attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeeds) + + numSpinSpeeds = len(list_speed_speeds) + asserts.assert_less_equal(numSpinSpeeds, MAX_SPIN_SPEEDS, "List of SpinSpeeds larger than maximum allowed") + + # Read the SpinSpeedCurrent attribute + self.step(3) + logger.info("Doing Step 3") + spin_speed_current = await self.read_single_attribute_check_success(endpoint=endpoint, + cluster=Clusters.Objects.LaundryWasherControls, + attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent) + asserts.assert_true(isinstance(spin_speed_current, int), "SpinSpeedCurrent has an invalid value") + asserts.assert_true(0 <= spin_speed_current <= (numSpinSpeeds - 1), 0, "SpinSpeedCurrent outside valid range") + + # Write a valid SpinSpeedCurrent value + self.step(4) + logger.info("Doing Step 4") + requested_speed = random.randint(0, numSpinSpeeds - 1) + result = await self.default_controller.WriteAttribute(self.dut_node_id, + [(endpoint, Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(requested_speed))]) + asserts.assert_equal(result[0].Status, Status.Success, "Failed to write SpinSpeed value") + + # Read SpinSpeedCurrent value and verify that was changed. + self.step(5) + logger.info("Doing Step 5") + current_value = await self.read_single_attribute_check_success(endpoint=endpoint, + cluster=Clusters.Objects.LaundryWasherControls, + attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent) + asserts.assert_equal(current_value, requested_speed, "Value obtained different than the previously written one") + + # Try to write an invalid value (outside supported range) + self.step(6) + logger.info("Doing Step 6") + result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(numSpinSpeeds))]) + asserts.assert_equal(result[0].Status, Status.ConstraintError, + "Trying to write an invalid value should return ConstraintError") + + +if __name__ == "__main__": + default_matter_test_main() From a6da576512a4054d17b76f66f060bf1f0643f2b5 Mon Sep 17 00:00:00 2001 From: Moises Terrones Date: Wed, 4 Dec 2024 10:54:05 -0600 Subject: [PATCH 02/12] Remove test logs --- src/python_testing/TC_WASHERCTRL_2_1.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py index 18de4f22b0790c..2d354bd0792ce8 100644 --- a/src/python_testing/TC_WASHERCTRL_2_1.py +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -84,7 +84,6 @@ async def test_TC_WASHERCTRL_2_1(self): # Read the SpinSpeeds attributes self.step(2) - logger.info("Doing Step 2") list_speed_speeds = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=Clusters.Objects.LaundryWasherControls, attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeeds) @@ -94,7 +93,6 @@ async def test_TC_WASHERCTRL_2_1(self): # Read the SpinSpeedCurrent attribute self.step(3) - logger.info("Doing Step 3") spin_speed_current = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=Clusters.Objects.LaundryWasherControls, attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent) @@ -103,7 +101,6 @@ async def test_TC_WASHERCTRL_2_1(self): # Write a valid SpinSpeedCurrent value self.step(4) - logger.info("Doing Step 4") requested_speed = random.randint(0, numSpinSpeeds - 1) result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(requested_speed))]) @@ -111,7 +108,6 @@ async def test_TC_WASHERCTRL_2_1(self): # Read SpinSpeedCurrent value and verify that was changed. self.step(5) - logger.info("Doing Step 5") current_value = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=Clusters.Objects.LaundryWasherControls, attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent) @@ -119,7 +115,6 @@ async def test_TC_WASHERCTRL_2_1(self): # Try to write an invalid value (outside supported range) self.step(6) - logger.info("Doing Step 6") result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(numSpinSpeeds))]) asserts.assert_equal(result[0].Status, Status.ConstraintError, "Trying to write an invalid value should return ConstraintError") From 5f86eb252da7933d02d045f449100a3bf1420da6 Mon Sep 17 00:00:00 2001 From: Moises Terrones Date: Wed, 4 Dec 2024 11:33:27 -0600 Subject: [PATCH 03/12] Fix and add missing assert --- src/python_testing/TC_WASHERCTRL_2_1.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py index 2d354bd0792ce8..4446ef2cec5e21 100644 --- a/src/python_testing/TC_WASHERCTRL_2_1.py +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -88,6 +88,7 @@ async def test_TC_WASHERCTRL_2_1(self): cluster=Clusters.Objects.LaundryWasherControls, attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeeds) + asserts.assert_true(isinstance(list_speed_speeds, list), "Returned value was not a list") numSpinSpeeds = len(list_speed_speeds) asserts.assert_less_equal(numSpinSpeeds, MAX_SPIN_SPEEDS, "List of SpinSpeeds larger than maximum allowed") @@ -97,7 +98,7 @@ async def test_TC_WASHERCTRL_2_1(self): cluster=Clusters.Objects.LaundryWasherControls, attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent) asserts.assert_true(isinstance(spin_speed_current, int), "SpinSpeedCurrent has an invalid value") - asserts.assert_true(0 <= spin_speed_current <= (numSpinSpeeds - 1), 0, "SpinSpeedCurrent outside valid range") + asserts.assert_true(0 <= spin_speed_current <= (numSpinSpeeds - 1), "SpinSpeedCurrent outside valid range") # Write a valid SpinSpeedCurrent value self.step(4) From 4a1e6850545699a0b14f1e2932a2c5ce5292c53d Mon Sep 17 00:00:00 2001 From: Moises Terrones Date: Wed, 4 Dec 2024 19:42:04 -0600 Subject: [PATCH 04/12] replace WriteAttribute with write_single_attribute --- src/python_testing/TC_WASHERCTRL_2_1.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py index 4446ef2cec5e21..28f8855169975f 100644 --- a/src/python_testing/TC_WASHERCTRL_2_1.py +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -103,9 +103,8 @@ async def test_TC_WASHERCTRL_2_1(self): # Write a valid SpinSpeedCurrent value self.step(4) requested_speed = random.randint(0, numSpinSpeeds - 1) - result = await self.default_controller.WriteAttribute(self.dut_node_id, - [(endpoint, Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(requested_speed))]) - asserts.assert_equal(result[0].Status, Status.Success, "Failed to write SpinSpeed value") + result = await self.write_single_attribute(attribute_value=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(requested_speed), + endpoint_id=endpoint) # Read SpinSpeedCurrent value and verify that was changed. self.step(5) From f4450f04d6f85ef1e19ba6ba3681833116cf97d6 Mon Sep 17 00:00:00 2001 From: Moises Terrones Date: Wed, 4 Dec 2024 19:59:27 -0600 Subject: [PATCH 05/12] Change second write --- src/python_testing/TC_WASHERCTRL_2_1.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py index 28f8855169975f..c7078d335e93ab 100644 --- a/src/python_testing/TC_WASHERCTRL_2_1.py +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -115,9 +115,9 @@ async def test_TC_WASHERCTRL_2_1(self): # Try to write an invalid value (outside supported range) self.step(6) - result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(numSpinSpeeds))]) - asserts.assert_equal(result[0].Status, Status.ConstraintError, - "Trying to write an invalid value should return ConstraintError") + result = await self.write_single_attribute(attribute_value=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(numSpinSpeeds), + endpoint_id=endpoint, expect_success=False) + asserts.assert_equal(result, Status.ConstraintError, "Trying to write an invalid value should return ConstraintError") if __name__ == "__main__": From 9f6489694837c636e59fd7cb69c3b82909d5776a Mon Sep 17 00:00:00 2001 From: Moises Terrones Date: Thu, 19 Dec 2024 15:53:45 -0600 Subject: [PATCH 06/12] Change decorator for test to allow pic validation --- src/python_testing/TC_WASHERCTRL_2_1.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py index c7078d335e93ab..34fc757d79823b 100644 --- a/src/python_testing/TC_WASHERCTRL_2_1.py +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, default_matter_test_main, run_if_endpoint_matches, has_feature from mobly import asserts logger = logging.getLogger(__name__) @@ -58,6 +58,8 @@ def desc_TC_WASHERCTRL_2_1(self) -> str: def pics_TC_WASHERCTRL_2_1(self) -> list[str]: pics = [ "WASHERCTRL.S.F00", + "WASHERCTRL.S.A0000", + "WASHERCTRL.S.A0001" ] return pics @@ -65,17 +67,23 @@ def steps_TC_WASHERCTRL_2_1(self) -> list[TestStep]: steps = [ TestStep(1, "Commissioning, already done", is_commissioning=True), - TestStep(2, "TH reads from the DUT the SpinSpeeds attribute"), - TestStep(3, "TH reads from the DUT the SpinSpeedCurrent attribute"), - TestStep(4, "TH writes a supported SpinSpeedCurrent attribute that is a valid index into the list" - + "of spin speeds (0 to numSpinSpeeds - 1)"), - TestStep(5, "After a few seconds, TH reads from the DUT the SpinSpeedCurrent attribute"), - TestStep(6, "TH writes an unsupported SpinSpeedCurrent attribute that is other than 0 to DUT") + TestStep(2, description="TH reads from the DUT the SpinSpeeds attribute", + expectation="Verify that the DUT response contains a list of strings. The maximum size of the list is 16."), + TestStep(3, description="TH reads from the DUT the SpinSpeedCurrent attribute", + expectation="Verify that the DUT response contains a uint8 with value between 0 and numSpinSpeeds-1 inclusive."), + TestStep(4, description="TH writes a supported SpinSpeedCurrent attribute that is a valid index into the list" + + "of spin speeds (0 to numSpinSpeeds - 1)", + expectation="Verify DUT responds w/ status SUCCESS(0x00)"), + TestStep(5, description="After a few seconds, TH reads from the DUT the SpinSpeedCurrent attribute", + expectation="Value is the same as was written in step 4"), + TestStep(6, description="TH writes an unsupported SpinSpeedCurrent attribute that is other than 0 to DUT", + expectation="Verify that the DUT response contains Status CONSTRAINT_ERROR response") ] return steps - @async_test_body + @run_if_endpoint_matches(has_feature(Clusters.LaundryWasherControls, + Clusters.LaundryWasherControls.Bitmaps.Feature.kSpin)) async def test_TC_WASHERCTRL_2_1(self): endpoint = self.get_endpoint(default=1) From 13eee8a491331c08ba55a1ee70edb0c0351f40a2 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 6 Jan 2025 17:46:09 +0000 Subject: [PATCH 07/12] Restyled by isort --- src/python_testing/TC_WASHERCTRL_2_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py index 34fc757d79823b..05fe796bc6cd54 100644 --- a/src/python_testing/TC_WASHERCTRL_2_1.py +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, default_matter_test_main, run_if_endpoint_matches, has_feature +from chip.testing.matter_testing import MatterBaseTest, TestStep, default_matter_test_main, has_feature, run_if_endpoint_matches from mobly import asserts logger = logging.getLogger(__name__) From ce6168d822f38895009448c667ec9d10006f7aa7 Mon Sep 17 00:00:00 2001 From: Moises Terrones Date: Wed, 8 Jan 2025 01:02:04 +0000 Subject: [PATCH 08/12] Add endpoint to WASHERCTRL test --- src/python_testing/TC_WASHERCTRL_2_1.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py index 05fe796bc6cd54..56a74424778cab 100644 --- a/src/python_testing/TC_WASHERCTRL_2_1.py +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -28,6 +28,7 @@ # --commissioning-method on-network # --discriminator 1234 # --passcode 20202021 +# --endpoint 1 # --PICS src/app/tests/suites/certification/ci-pics-values # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto From 2d76e13b0418cd0a8d3d989dc6439840905d9f1e Mon Sep 17 00:00:00 2001 From: Moises Terrones Date: Thu, 9 Jan 2025 21:48:03 +0000 Subject: [PATCH 09/12] Add loop for testing of all valid SpinSpeed values --- src/python_testing/TC_WASHERCTRL_2_1.py | 34 ++++++++++++------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py index 56a74424778cab..314ae2b9526c19 100644 --- a/src/python_testing/TC_WASHERCTRL_2_1.py +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -73,11 +73,9 @@ def steps_TC_WASHERCTRL_2_1(self) -> list[TestStep]: TestStep(3, description="TH reads from the DUT the SpinSpeedCurrent attribute", expectation="Verify that the DUT response contains a uint8 with value between 0 and numSpinSpeeds-1 inclusive."), TestStep(4, description="TH writes a supported SpinSpeedCurrent attribute that is a valid index into the list" - + "of spin speeds (0 to numSpinSpeeds - 1)", - expectation="Verify DUT responds w/ status SUCCESS(0x00)"), - TestStep(5, description="After a few seconds, TH reads from the DUT the SpinSpeedCurrent attribute", - expectation="Value is the same as was written in step 4"), - TestStep(6, description="TH writes an unsupported SpinSpeedCurrent attribute that is other than 0 to DUT", + + "of spin speeds (0 to numSpinSpeeds - 1) and then read the SpinSpeedCurrent value", + expectation="Verify DUT responds w/ status SUCCESS(0x00) and the SpinSpeedCurrent value was set accordingly"), + TestStep(5, description="TH writes an unsupported SpinSpeedCurrent attribute that is other than 0 to DUT", expectation="Verify that the DUT response contains Status CONSTRAINT_ERROR response") ] @@ -96,7 +94,7 @@ async def test_TC_WASHERCTRL_2_1(self): list_speed_speeds = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=Clusters.Objects.LaundryWasherControls, attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeeds) - + asserts.assert_true(isinstance(list_speed_speeds, list), "Returned value was not a list") numSpinSpeeds = len(list_speed_speeds) asserts.assert_less_equal(numSpinSpeeds, MAX_SPIN_SPEEDS, "List of SpinSpeeds larger than maximum allowed") @@ -109,21 +107,21 @@ async def test_TC_WASHERCTRL_2_1(self): asserts.assert_true(isinstance(spin_speed_current, int), "SpinSpeedCurrent has an invalid value") asserts.assert_true(0 <= spin_speed_current <= (numSpinSpeeds - 1), "SpinSpeedCurrent outside valid range") - # Write a valid SpinSpeedCurrent value self.step(4) - requested_speed = random.randint(0, numSpinSpeeds - 1) - result = await self.write_single_attribute(attribute_value=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(requested_speed), - endpoint_id=endpoint) - - # Read SpinSpeedCurrent value and verify that was changed. - self.step(5) - current_value = await self.read_single_attribute_check_success(endpoint=endpoint, - cluster=Clusters.Objects.LaundryWasherControls, - attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent) - asserts.assert_equal(current_value, requested_speed, "Value obtained different than the previously written one") + for requested_speed in range(0, numSpinSpeeds - 1): + # Write a valid SpinSpeedCurrent value + result = await self.write_single_attribute(attribute_value=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(requested_speed), + endpoint_id=endpoint) + asserts.assert_equal(result, Status.Success, "Error when trying to write a valid SpinSpeed value") + + # Read SpinSpeedCurrent value and verify that was changed. + current_value = await self.read_single_attribute_check_success(endpoint=endpoint, + cluster=Clusters.Objects.LaundryWasherControls, + attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent) + asserts.assert_equal(current_value, requested_speed, "Value obtained different than the previously written one") # Try to write an invalid value (outside supported range) - self.step(6) + self.step(5) result = await self.write_single_attribute(attribute_value=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(numSpinSpeeds), endpoint_id=endpoint, expect_success=False) asserts.assert_equal(result, Status.ConstraintError, "Trying to write an invalid value should return ConstraintError") From 5aa48cbee1af614ead15265244b5bfddead2ac81 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 9 Jan 2025 21:49:09 +0000 Subject: [PATCH 10/12] Restyled by autopep8 --- src/python_testing/TC_WASHERCTRL_2_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py index 314ae2b9526c19..70814d41df856d 100644 --- a/src/python_testing/TC_WASHERCTRL_2_1.py +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -94,7 +94,7 @@ async def test_TC_WASHERCTRL_2_1(self): list_speed_speeds = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=Clusters.Objects.LaundryWasherControls, attribute=Clusters.LaundryWasherControls.Attributes.SpinSpeeds) - + asserts.assert_true(isinstance(list_speed_speeds, list), "Returned value was not a list") numSpinSpeeds = len(list_speed_speeds) asserts.assert_less_equal(numSpinSpeeds, MAX_SPIN_SPEEDS, "List of SpinSpeeds larger than maximum allowed") From b18c9cfb39b272b8f0603f1b20ffcaece7b8d6e6 Mon Sep 17 00:00:00 2001 From: Moises Terrones Date: Thu, 9 Jan 2025 23:00:14 +0000 Subject: [PATCH 11/12] Remove unused import --- src/python_testing/TC_WASHERCTRL_2_1.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py index 70814d41df856d..b6f44351541e03 100644 --- a/src/python_testing/TC_WASHERCTRL_2_1.py +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -37,7 +37,6 @@ # === END CI TEST ARGUMENTS === import logging -import random import chip.clusters as Clusters from chip.interaction_model import Status From 0c26a201974940919a5c6273a293752ac94866d5 Mon Sep 17 00:00:00 2001 From: Moises Terrones Date: Tue, 14 Jan 2025 09:36:43 -0600 Subject: [PATCH 12/12] Update src/python_testing/TC_WASHERCTRL_2_1.py Co-authored-by: Andrei Litvin --- src/python_testing/TC_WASHERCTRL_2_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/TC_WASHERCTRL_2_1.py b/src/python_testing/TC_WASHERCTRL_2_1.py index b6f44351541e03..d5eeb219fe2f23 100644 --- a/src/python_testing/TC_WASHERCTRL_2_1.py +++ b/src/python_testing/TC_WASHERCTRL_2_1.py @@ -107,7 +107,7 @@ async def test_TC_WASHERCTRL_2_1(self): asserts.assert_true(0 <= spin_speed_current <= (numSpinSpeeds - 1), "SpinSpeedCurrent outside valid range") self.step(4) - for requested_speed in range(0, numSpinSpeeds - 1): + for requested_speed in range(0, numSpinSpeeds): # Write a valid SpinSpeedCurrent value result = await self.write_single_attribute(attribute_value=Clusters.LaundryWasherControls.Attributes.SpinSpeedCurrent(requested_speed), endpoint_id=endpoint)