Skip to content

Commit

Permalink
Use Globals.Enums.AtomicRequestTypeEnum instead of hard coded values …
Browse files Browse the repository at this point in the history
…in TC_TSTAT_4_2 (#34824)
  • Loading branch information
hasty authored and pull[bot] committed Oct 4, 2024
1 parent 03b51d9 commit 2523096
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/python_testing/TC_TSTAT_4_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand All @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit 2523096

Please sign in to comment.