Skip to content

Commit

Permalink
lint pass
Browse files Browse the repository at this point in the history
  • Loading branch information
rochaferraz committed Jul 31, 2024
1 parent 1f3be3f commit 8ae2684
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/python_testing/TC_BRBINFO_4_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,19 @@

import logging
import os
import random
import re
import queue
import pathlib
import uuid
import subprocess
import time
import signal
import time


import chip.clusters as Clusters
from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, SimpleEventCallback
from mobly import asserts

from chip import ChipDeviceCtrl # Needed before chip.FabricAdmin
import chip.CertificateAuthority
from chip.ChipDeviceCtrl import CommissioningParameters

logger = logging.getLogger(__name__)
kRootEndpointId = 0
Expand Down Expand Up @@ -150,7 +145,7 @@ async def setup_class(self):
def teardown_class(self):
logging.warning("Stopping app with SIGTERM")
self.app_process.send_signal(signal.SIGTERM.value)
test_app_exit_code = self.app_process.wait()
self.app_process.wait()
os.remove(self.kvs)
super().teardown_class()

Expand All @@ -164,14 +159,13 @@ async def test_TC_BRBINFO_4_1(self):
icdm_cluster = Clusters.Objects.IcdManagement
icdm_attributes = icdm_cluster.Attributes
brb_info_cluster = Clusters.Objects.BridgedDeviceBasicInformation
brb_info_attributes = brb_info_cluster.Attributes
basic_info_cluster = Clusters.Objects.BasicInformation
basic_info_attributes = basic_info_cluster.Attributes

# Preconditions
self.step("0")

logging.info(f"Ensuring DUT is commissioned to TH")
logging.info("Ensuring DUT is commissioned to TH")

# Confirms commissioning of DUT on TH as it reads basic info
await self._read_attribute_expect_success(
Expand All @@ -181,7 +175,7 @@ async def test_TC_BRBINFO_4_1(self):
self.dut_node_id
)

logging.info(f"Ensuring ICD is commissioned to TH")
logging.info("Ensuring ICD is commissioned to TH")

# Confirms commissioning of ICD on TH as it reads basic info
await self._read_attribute_expect_success(
Expand Down Expand Up @@ -223,7 +217,7 @@ async def test_TC_BRBINFO_4_1(self):
logging.info(f"Sending KeepActiveCommand({stay_active_duration}ms)")
self._send_keep_active_command(stay_active_duration)

logging.info(f"Waiting for ActiveChanged from DUT...")
logging.info("Waiting for ActiveChanged from DUT...")
promised_active_duration = await self._wait_for_active_changed_event((idle_mode_duration + max(active_mode_duration, stay_active_duration))/1000)

asserts.assert_true(promised_active_duration >= stay_active_duration, "PromisedActiveDuration < StayActiveDuration")
Expand All @@ -234,7 +228,7 @@ async def test_TC_BRBINFO_4_1(self):
logging.info(f"Sending KeepActiveCommand({stay_active_duration}ms)")
self._send_keep_active_command(stay_active_duration)

logging.info(f"Waiting for ActiveChanged from DUT...")
logging.info("Waiting for ActiveChanged from DUT...")
promised_active_duration = await self._wait_for_active_changed_event((idle_mode_duration + max(active_mode_duration, stay_active_duration))/1000)

# wait for active time duration
Expand All @@ -252,10 +246,10 @@ async def test_TC_BRBINFO_4_1(self):
self._send_keep_active_command(stay_active_duration)
time.sleep(100)

logging.info(f"Waiting for ActiveChanged from DUT...")
logging.info("Waiting for ActiveChanged from DUT...")
promised_active_duration = await self._wait_for_active_changed_event((idle_mode_duration + max(active_mode_duration, stay_active_duration))/1000)

asserts.assert_true(q.qSize() == 0, "More than one event received from DUT")
asserts.assert_true(self.q.qSize() == 0, "More than one event received from DUT")

self.step("3")

Expand All @@ -267,7 +261,7 @@ async def test_TC_BRBINFO_4_1(self):
self.app_process.send_signal(signal.SIGSTOP.value)

if not self.is_ci:
logging.info(f"Waiting for 60 minutes")
logging.info("Waiting for 60 minutes")
time.sleep(60*60)

## resume the ICD
Expand Down

0 comments on commit 8ae2684

Please sign in to comment.