From fd1421cae9fe1ce584d191b8d5304991f07bf9d3 Mon Sep 17 00:00:00 2001 From: Hasty Granbery Date: Thu, 8 Aug 2024 08:44:10 -0700 Subject: [PATCH] Use Globals.Enums.AtomicRequestTypeEnum instead of hard coded values in TC_TSTAT_4_2 (#34824) --- 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)