Skip to content

Commit

Permalink
Fix restyle
Browse files Browse the repository at this point in the history
  • Loading branch information
raul-marquez-csa committed May 22, 2024
1 parent 28d683d commit 46993e1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/python_testing/matter_testing_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def __call__(self, path: TypedAttributePath, transaction: SubscriptionTransactio
"""This is the subscription callback when an attribute is updated.
It checks the passed in attribute is the same as the subscribed to attribute and
then posts it into the queue for later processing."""

asserts.assert_equal(path.AttributeType, self._expected_attribute,
f"[AttributeChangeCallback] Attribute mismatch. Expected: {self._expected_attribute}, received: {path.AttributeType}")
logging.info(f"[AttributeChangeCallback] Attribute update callback for {path.AttributeType}")
Expand All @@ -331,13 +331,15 @@ def wait_for_report(self):
try:
path, transaction = self._output.get(block=True, timeout=10)
except queue.Empty:
asserts.fail(f"[AttributeChangeCallback] Failed to receive a report for the {self._expected_attribute} attribute change")
asserts.fail(
f"[AttributeChangeCallback] Failed to receive a report for the {self._expected_attribute} attribute change")

asserts.assert_equal(path.AttributeType, self._expected_attribute,
f"[AttributeChangeCallback] Received incorrect report. Expected: {self._expected_attribute}, received: {path.AttributeType}")
try:
attribute_value = transaction.GetAttribute(path)
logging.info(f"[AttributeChangeCallback] Got attribute subscription report. Attribute {path.AttributeType}. Updated value: {attribute_value}. SubscriptionId: {transaction.subscriptionId}")
logging.info(
f"[AttributeChangeCallback] Got attribute subscription report. Attribute {path.AttributeType}. Updated value: {attribute_value}. SubscriptionId: {transaction.subscriptionId}")
except KeyError:
asserts.fail("[AttributeChangeCallback] Attribute {expected_attribute} not found in returned report")

Expand Down

0 comments on commit 46993e1

Please sign in to comment.