From c1e5d29d040bb48732a6ec7be57bcea88fe1a3ec Mon Sep 17 00:00:00 2001 From: Hasty Granbery Date: Tue, 6 Aug 2024 14:00:45 -0700 Subject: [PATCH] Use Globals.Enums.AtomicRequestTypeEnum instead of hard coded values in TC_TSTAT_4_2 --- src/python_testing/TC_TSTAT_4_2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/python_testing/TC_TSTAT_4_2.py b/src/python_testing/TC_TSTAT_4_2.py index 513715b7d30f31..58d78ef4491a73 100644 --- a/src/python_testing/TC_TSTAT_4_2.py +++ b/src/python_testing/TC_TSTAT_4_2.py @@ -30,6 +30,7 @@ import logging import chip.clusters as Clusters +from chip.clusters import Globals from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main @@ -65,7 +66,7 @@ async def send_edit_atomic_request_begin_command(self, endpoint: int = None, expected_status: Status = Status.Success): try: - await self.send_single_cmd(cmd=cluster.Commands.AtomicRequest(requestType=0, + await self.send_single_cmd(cmd=cluster.Commands.AtomicRequest(requestType=Globals.Enums.AtomicRequestTypeEnum.kBeginWrite, attributeRequests=[ cluster.Attributes.Presets.attribute_id], timeout=1800), @@ -81,7 +82,7 @@ async def send_edit_atomic_request_commit_command(self, expected_overall_status: Status = Status.Success, expected_preset_status: Status = Status.Success): try: - response = await self.send_single_cmd(cmd=cluster.Commands.AtomicRequest(requestType=1, + response = await self.send_single_cmd(cmd=cluster.Commands.AtomicRequest(requestType=Globals.Enums.AtomicRequestTypeEnum.kCommitWrite, attributeRequests=[cluster.Attributes.Presets.attribute_id, cluster.Attributes.Schedules.attribute_id]), endpoint=endpoint) asserts.assert_equal(expected_status, Status.Success, "We expected we had a valid commit command") @@ -100,7 +101,7 @@ async def send_edit_atomic_request_rollback_command(self, endpoint: int = None, expected_status: Status = Status.Success): try: - await self.send_single_cmd(cmd=cluster.Commands.AtomicRequest(requestType=2, + await self.send_single_cmd(cmd=cluster.Commands.AtomicRequest(requestType=Globals.Enums.AtomicRequestTypeEnum.kRollbackWrite, attributeRequests=[cluster.Attributes.Presets.attribute_id, cluster.Attributes.Schedules.attribute_id]), endpoint=endpoint) asserts.assert_equal(expected_status, Status.Success)