diff --git a/docs/testing/python.md b/docs/testing/python.md index 4541871dcba139..a957074e3ce1f9 100644 --- a/docs/testing/python.md +++ b/docs/testing/python.md @@ -25,7 +25,7 @@ Python tests located in src/python_testing section should include various parameters and their respective values, which will guide the test runner on how to execute the tests. - All test classes inherit from `MatterBaseTest` in - [matter_testing.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py) + [matter_testing_support.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_support.py) - Support for commissioning using the python controller - Default controller (`self.default_controller`) of type `ChipDeviceCtrl` - `MatterBaseTest` inherits from the Mobly BaseTestClass @@ -38,7 +38,7 @@ Python tests located in src/python_testing decorated with the @async_test_body decorator - Use `ChipDeviceCtrl` to interact with the DUT - Controller API is in `ChipDeviceCtrl.py` (see API doc in file) - - Some support methods in `matter_testing.py` + - Some support methods in `matter_testing_support.py` - Use Mobly assertions for failing tests - `self.step()` along with a `steps_*` method to mark test plan steps for cert tests @@ -379,7 +379,7 @@ pai = await dev_ctrl.SendCommand(nodeid, 0, Clusters.OperationalCredentials.Comm ## Mobly helpers The test system is based on Mobly, and the -[matter_testing.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py) +[matter_testing_support.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_support.py) class provides some helpers for Mobly integration. - `default_matter_test_main` @@ -561,11 +561,11 @@ these steps to set this up: ## Other support utilities -- `basic_composition` +- `basic_composition_support` - wildcard read, whole device analysis - `CommissioningFlowBlocks` - various commissioning support for core tests -- `spec_parsing` +- `spec_parsing_support` - parsing data model XML into python readable format # Running tests locally diff --git a/scripts/spec_xml/generate_spec_xml.py b/scripts/spec_xml/generate_spec_xml.py index 43582fdb366918..0d41b3f5194b5a 100755 --- a/scripts/spec_xml/generate_spec_xml.py +++ b/scripts/spec_xml/generate_spec_xml.py @@ -24,17 +24,26 @@ from pathlib import Path import click -from paths import Branch, get_chip_root, get_data_model_path, get_documentation_file_path, get_in_progress_defines -# Use the get_in_progress_defines() function to fetch the in-progress defines -CURRENT_IN_PROGRESS_DEFINES = get_in_progress_defines() - -# Replace hardcoded paths with dynamic paths using paths.py functions -DEFAULT_CHIP_ROOT = get_chip_root() -DEFAULT_OUTPUT_DIR_1_3 = get_data_model_path(Branch.V1_3) -DEFAULT_OUTPUT_DIR_IN_PROGRESS = get_data_model_path(Branch.IN_PROGRESS) -DEFAULT_OUTPUT_DIR_TOT = get_data_model_path(Branch.MASTER) -DEFAULT_DOCUMENTATION_FILE = get_documentation_file_path() +DEFAULT_CHIP_ROOT = os.path.abspath( + os.path.join(os.path.dirname(__file__), '..', '..')) +DEFAULT_OUTPUT_DIR_1_3 = os.path.abspath( + os.path.join(DEFAULT_CHIP_ROOT, 'data_model', '1.3')) +DEFAULT_OUTPUT_DIR_IN_PROGRESS = os.path.abspath( + os.path.join(DEFAULT_CHIP_ROOT, 'data_model', 'in_progress')) +DEFAULT_OUTPUT_DIR_TOT = os.path.abspath( + os.path.join(DEFAULT_CHIP_ROOT, 'data_model', 'master')) +DEFAULT_DOCUMENTATION_FILE = os.path.abspath( + os.path.join(DEFAULT_CHIP_ROOT, 'docs', 'spec_clusters.md')) + +# questions +# is energy-calendar still in? +# is heat-pump out? wasn't in 0.7 +# location-cluster - is this define gone now? +# queuedpreset - is this define gone now? +CURRENT_IN_PROGRESS_DEFINES = ['aliro', 'atomicwrites', 'battery-storage', 'device-location', 'e2e-jf', 'energy-calendar', 'energy-drlc', + 'energy-management', 'heat-pump', 'hrap-1', 'hvac', 'matter-fabric-synchronization', 'metering', 'secondary-net', + 'service-area-cluster', 'solar-power', 'tcp', 'water-heater', 'wifiSetup'] def get_xml_path(filename, output_dir): @@ -81,6 +90,7 @@ def make_asciidoc(target: str, include_in_progress: str, spec_dir: str, dry_run: '--include-in-progress', type=click.Choice(['All', 'None', 'Current']), default='All') def main(scraper, spec_root, output_dir, dry_run, include_in_progress): + # Clusters need to be scraped first because the cluster directory is passed to the device type directory if not output_dir: output_dir_map = {'All': DEFAULT_OUTPUT_DIR_TOT, 'None': DEFAULT_OUTPUT_DIR_1_3, 'Current': DEFAULT_OUTPUT_DIR_IN_PROGRESS} output_dir = output_dir_map[include_in_progress] @@ -93,28 +103,30 @@ def main(scraper, spec_root, output_dir, dry_run, include_in_progress): def scrape_clusters(scraper, spec_root, output_dir, dry_run, include_in_progress): src_dir = os.path.abspath(os.path.join(spec_root, 'src')) - sdm_clusters_dir = os.path.abspath(os.path.join(src_dir, 'service_device_management')) + sdm_clusters_dir = os.path.abspath( + os.path.join(src_dir, 'service_device_management')) app_clusters_dir = os.path.abspath(os.path.join(src_dir, 'app_clusters')) dm_clusters_dir = os.path.abspath(os.path.join(src_dir, 'data_model')) - media_clusters_dir = os.path.abspath(os.path.join(app_clusters_dir, 'media')) - - clusters_output_dir = os.path.join(output_dir, 'clusters') + media_clusters_dir = os.path.abspath( + os.path.join(app_clusters_dir, 'media')) + clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters')) if not os.path.exists(clusters_output_dir): os.makedirs(clusters_output_dir) - print('Generating main spec to get file include list - this may take a few minutes') + print('Generating main spec to get file include list - this make take a few minutes') main_out = make_asciidoc('pdf', include_in_progress, spec_root, dry_run) - print('Generating cluster spec to get file include list - this may take a few minutes') + print('Generating cluster spec to get file include list - this make take a few minutes') cluster_out = make_asciidoc('pdf-appclusters-book', include_in_progress, spec_root, dry_run) def scrape_cluster(filename: str) -> None: base = Path(filename).stem if base not in main_out and base not in cluster_out: - print(f'Skipping file: {base} as it is not compiled into the asciidoc') + print(f'skipping file: {base} as it is not compiled into the asciidoc') return xml_path = get_xml_path(filename, clusters_output_dir) - cmd = [scraper, 'cluster', '-i', filename, '-o', xml_path, '-nd'] + cmd = [scraper, 'cluster', '-i', filename, '-o', + xml_path, '-nd'] if include_in_progress == 'All': cmd.extend(['--define', 'in-progress']) elif include_in_progress == 'Current': @@ -138,29 +150,33 @@ def scrape_all_clusters(dir: str, exclude_list: list[str] = []) -> None: tree = ElementTree.parse(f'{xml_path}') root = tree.getroot() cluster = next(root.iter('cluster')) + # If there's no cluster ID table, this isn't a cluster try: next(cluster.iter('clusterIds')) except StopIteration: + # If there's no cluster ID table, this isn't a cluster just some kind of intro adoc print(f'Removing file {xml_path} as it does not include any cluster definitions') os.remove(xml_path) continue def scrape_device_types(scraper, spec_root, output_dir, dry_run, include_in_progress): - device_type_dir = os.path.abspath(os.path.join(spec_root, 'src', 'device_types')) - device_types_output_dir = os.path.abspath(os.path.join(output_dir, 'device_types')) + device_type_dir = os.path.abspath( + os.path.join(spec_root, 'src', 'device_types')) + device_types_output_dir = os.path.abspath( + os.path.join(output_dir, 'device_types')) clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters')) if not os.path.exists(device_types_output_dir): os.makedirs(device_types_output_dir) - print('Generating device type library to get file include list - this may take a few minutes') + print('Generating device type library to get file include list - this make take a few minutes') device_type_output = make_asciidoc('pdf-devicelibrary-book', include_in_progress, spec_root, dry_run) def scrape_device_type(filename: str) -> None: base = Path(filename).stem if base not in device_type_output: - print(f'Skipping file: {filename} as it is not compiled into the asciidoc') + print(f'skipping file: {filename} as it is not compiled into the asciidoc') return xml_path = get_xml_path(filename, device_types_output_dir) cmd = [scraper, 'devicetype', '-c', '-cls', clusters_output_dir, diff --git a/scripts/spec_xml/paths.py b/scripts/spec_xml/paths.py deleted file mode 100644 index 3a5159cc514bf1..00000000000000 --- a/scripts/spec_xml/paths.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2024 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -from enum import Enum - -# Define a branch enum for different versions or branches - - -class Branch(Enum): - MASTER = "master" - V1_3 = "v1_3" - V1_4 = "v1_4" - IN_PROGRESS = "in_progress" - - -def get_chip_root(): - """ - Returns the CHIP root directory, trying the environment variable first - and falling back if necessary. - """ - chip_root = os.getenv('PW_PROJECT_ROOT') - if chip_root: - return chip_root - else: - try: - return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) - except Exception as e: - raise EnvironmentError( - "Unable to determine CHIP root directory. Please ensure the environment is activated." - ) from e - - -def get_data_model_path(branch: Branch): - """ - Returns the path to the data model directory for a given branch. - """ - chip_root = get_chip_root() - data_model_path = os.path.join(chip_root, 'data_model', branch.value) - if not os.path.exists(data_model_path): - raise FileNotFoundError(f"Data model path for branch {branch} does not exist: {data_model_path}") - return data_model_path - - -def get_spec_xml_output_path(): - """ - Returns the path to the output directory for generated XML files. - """ - chip_root = get_chip_root() - output_dir = os.path.join(chip_root, 'out', 'spec_xml') - if not os.path.exists(output_dir): - os.makedirs(output_dir) # Automatically create the directory if it doesn't exist - return output_dir - - -def get_documentation_file_path(): - """ - Returns the path to the documentation file. - """ - chip_root = get_chip_root() - documentation_file = os.path.join(chip_root, 'docs', 'spec_clusters.md') - if not os.path.exists(documentation_file): - raise FileNotFoundError(f"Documentation file does not exist: {documentation_file}") - return documentation_file - - -def get_python_testing_path(): - """ - Returns the path to the python_testing directory. - """ - chip_root = get_chip_root() - python_testing_path = os.path.join(chip_root, 'src', 'python_testing') - if not os.path.exists(python_testing_path): - raise FileNotFoundError(f"Python testing directory does not exist: {python_testing_path}") - return python_testing_path - - -def get_in_progress_defines(): - """ - Returns a list of defines that are currently in progress. - This can be updated dynamically as needed. - """ - return [ - 'aliro', 'atomicwrites', 'battery-storage', 'device-location', 'e2e-jf', - 'energy-calendar', 'energy-drlc', 'energy-management', 'heat-pump', 'hrap-1', - 'hvac', 'matter-fabric-synchronization', 'metering', 'secondary-net', - 'service-area-cluster', 'solar-power', 'tcp', 'water-heater', 'wifiSetup' - ] - - -def get_available_branches(): - """ - Return a list of available branches for the data model. - This can be expanded or dynamically fetched if necessary. - """ - return [Branch.MASTER, Branch.V1_3, Branch.V1_4] diff --git a/src/python_testing/MinimalRepresentation.py b/src/python_testing/MinimalRepresentation.py index 93ce543e09e98c..c99919a9080a8b 100644 --- a/src/python_testing/MinimalRepresentation.py +++ b/src/python_testing/MinimalRepresentation.py @@ -17,10 +17,10 @@ from dataclasses import dataclass, field -from chip.testing.conformance import ConformanceDecision -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.tlv import uint +from conformance_support import ConformanceDecision +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TCP_Tests.py b/src/python_testing/TCP_Tests.py index 10209346a0cd94..849b3a9c07d39e 100644 --- a/src/python_testing/TCP_Tests.py +++ b/src/python_testing/TCP_Tests.py @@ -33,7 +33,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_2.py b/src/python_testing/TC_ACE_1_2.py index 5a3812056125ab..4955cbd3ff3222 100644 --- a/src/python_testing/TC_ACE_1_2.py +++ b/src/python_testing/TC_ACE_1_2.py @@ -42,7 +42,7 @@ from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction, TypedAttributePath from chip.exceptions import ChipStackError from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index 2868d9548f7733..9e2108896df494 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_4.py b/src/python_testing/TC_ACE_1_4.py index 37577b62704f9d..0afdf03edee25c 100644 --- a/src/python_testing/TC_ACE_1_4.py +++ b/src/python_testing/TC_ACE_1_4.py @@ -42,7 +42,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_ACE_1_5.py b/src/python_testing/TC_ACE_1_5.py index 15c7380d23cff9..9766e9a0c6be66 100644 --- a/src/python_testing/TC_ACE_1_5.py +++ b/src/python_testing/TC_ACE_1_5.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACL_2_11.py b/src/python_testing/TC_ACL_2_11.py index e8aa253ae714af..9f4aea321813af 100644 --- a/src/python_testing/TC_ACL_2_11.py +++ b/src/python_testing/TC_ACL_2_11.py @@ -42,13 +42,13 @@ import queue import chip.clusters as Clusters +from basic_composition_support import arls_populated from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction, ValueDecodeFailure from chip.clusters.ClusterObjects import ALL_ACCEPTED_COMMANDS, ALL_ATTRIBUTES, ALL_CLUSTERS, ClusterEvent from chip.clusters.Objects import AccessControl from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.basic_composition import arls_populated -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACL_2_2.py b/src/python_testing/TC_ACL_2_2.py index 6f5ed4760c2279..219be92b35cedd 100644 --- a/src/python_testing/TC_ACL_2_2.py +++ b/src/python_testing/TC_ACL_2_2.py @@ -32,7 +32,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_AccessChecker.py b/src/python_testing/TC_AccessChecker.py index 5f3b3d69ec2146..23e8535f510650 100644 --- a/src/python_testing/TC_AccessChecker.py +++ b/src/python_testing/TC_AccessChecker.py @@ -23,13 +23,13 @@ from typing import Optional import chip.clusters as Clusters +from basic_composition_support import BasicCompositionTests from chip.interaction_model import Status -from chip.testing.basic_composition import BasicCompositionTests -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) -from chip.testing.spec_parsing import XmlCluster, build_xml_clusters from chip.tlv import uint +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) +from spec_parsing_support import XmlCluster, build_xml_clusters class AccessTestType(Enum): diff --git a/src/python_testing/TC_BOOLCFG_2_1.py b/src/python_testing/TC_BOOLCFG_2_1.py index 2e90245f479d3d..27e016da52c1ee 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -36,7 +36,7 @@ from operator import ior import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_3_1.py b/src/python_testing/TC_BOOLCFG_3_1.py index 8ed77f6ba812e5..4b3156bbe9e456 100644 --- a/src/python_testing/TC_BOOLCFG_3_1.py +++ b/src/python_testing/TC_BOOLCFG_3_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_4_1.py b/src/python_testing/TC_BOOLCFG_4_1.py index dfe6aac340269c..3cd7f3a9b21b9b 100644 --- a/src/python_testing/TC_BOOLCFG_4_1.py +++ b/src/python_testing/TC_BOOLCFG_4_1.py @@ -34,7 +34,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_4_2.py b/src/python_testing/TC_BOOLCFG_4_2.py index 093e389dcf41db..7897847accc7bf 100644 --- a/src/python_testing/TC_BOOLCFG_4_2.py +++ b/src/python_testing/TC_BOOLCFG_4_2.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_4_3.py b/src/python_testing/TC_BOOLCFG_4_3.py index 845d8e9d4a9e3f..aeb245a9be31e6 100644 --- a/src/python_testing/TC_BOOLCFG_4_3.py +++ b/src/python_testing/TC_BOOLCFG_4_3.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_4_4.py b/src/python_testing/TC_BOOLCFG_4_4.py index c585b14a8477b7..66a1d06c05e998 100644 --- a/src/python_testing/TC_BOOLCFG_4_4.py +++ b/src/python_testing/TC_BOOLCFG_4_4.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_5_1.py b/src/python_testing/TC_BOOLCFG_5_1.py index ec31d8341b388c..cef0eae01b9c12 100644 --- a/src/python_testing/TC_BOOLCFG_5_1.py +++ b/src/python_testing/TC_BOOLCFG_5_1.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_5_2.py b/src/python_testing/TC_BOOLCFG_5_2.py index fd6b88370d1c41..6ab8c82be629b2 100644 --- a/src/python_testing/TC_BOOLCFG_5_2.py +++ b/src/python_testing/TC_BOOLCFG_5_2.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py index f5eeec33449589..07b6fc2745b247 100644 --- a/src/python_testing/TC_BRBINFO_4_1.py +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -53,7 +53,7 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import IcdAppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_CADMIN_1_9.py b/src/python_testing/TC_CADMIN_1_9.py index b3b09afad31e25..060a540017cd58 100644 --- a/src/python_testing/TC_CADMIN_1_9.py +++ b/src/python_testing/TC_CADMIN_1_9.py @@ -40,7 +40,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.native import PyChipError -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_1.py b/src/python_testing/TC_CCTRL_2_1.py index b656973f6afe98..c689dd649be7c0 100644 --- a/src/python_testing/TC_CCTRL_2_1.py +++ b/src/python_testing/TC_CCTRL_2_1.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches +from matter_testing_support import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index a2e7b15dc2af99..76e8e83c92fd4d 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, - run_if_endpoint_matches) +from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, + run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py index fe7ed3de40702d..07d5706a22b030 100644 --- a/src/python_testing/TC_CCTRL_2_3.py +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, - run_if_endpoint_matches) +from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, + run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_CC_10_1.py b/src/python_testing/TC_CC_10_1.py index c2c76ecde0ca5f..2cbbf0fe9a19b6 100644 --- a/src/python_testing/TC_CC_10_1.py +++ b/src/python_testing/TC_CC_10_1.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts kCCAttributeValueIDs = [0x0001, 0x0003, 0x0004, 0x0007, 0x4000, 0x4001, 0x4002, 0x4003, 0x4004] diff --git a/src/python_testing/TC_CC_2_2.py b/src/python_testing/TC_CC_2_2.py index f974364115f1da..647bee1528b08c 100644 --- a/src/python_testing/TC_CC_2_2.py +++ b/src/python_testing/TC_CC_2_2.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters import ClusterObjects as ClusterObjects -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, - has_cluster, run_if_endpoint_matches) +from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, + has_cluster, run_if_endpoint_matches) from mobly import asserts from test_plan_support import commission_if_required, read_attribute, verify_success @@ -88,8 +88,7 @@ def entry_count_verification(reportList: str) -> str: 14, f'{THcommand} MoveHue with _MoveMode_ field set to Down, _Rate_ field set to 255 and remaining fields set to 0', verify_success()), TestStep( 15, f'{THcommand} MoveSaturation with _MoveMode_ field set to Down, _Rate_ field set to 255 and remaining fields set to 0', verify_success()), - TestStep(16, f'{ - THcommand} MoveToHue with _Hue_ field set to 254, _TransitionTime_ field set to 100, _Direction_ field set to Shortest and remaining fields set to 0', verify_success()), + TestStep(16, f'{THcommand} MoveToHue with _Hue_ field set to 254, _TransitionTime_ field set to 100, _Direction_ field set to Shortest and remaining fields set to 0', verify_success()), TestStep(17, store_values('reportedCurrentHueValuesList', 'CurrentHue')), TestStep(18, verify_entry_count('reportedCurrentHueValuesList', 'CurrentHue'), entry_count_verification('reportedCurrentHueValuesList')), diff --git a/src/python_testing/TC_CGEN_2_4.py b/src/python_testing/TC_CGEN_2_4.py index 7db0ddca28ce04..1cf2f7e8a038e7 100644 --- a/src/python_testing/TC_CGEN_2_4.py +++ b/src/python_testing/TC_CGEN_2_4.py @@ -46,7 +46,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.native import PyChipError -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Commissioning stage numbers - we should find a better way to match these to the C++ code diff --git a/src/python_testing/TC_CNET_1_4.py b/src/python_testing/TC_CNET_1_4.py index 2c69456e86e57d..7e19f8dee9c1c6 100644 --- a/src/python_testing/TC_CNET_1_4.py +++ b/src/python_testing/TC_CNET_1_4.py @@ -38,7 +38,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts kRootEndpointId = 0 diff --git a/src/python_testing/TC_CNET_4_4.py b/src/python_testing/TC_CNET_4_4.py index 223cfdf588175a..12407e6c5fd6b0 100644 --- a/src/python_testing/TC_CNET_4_4.py +++ b/src/python_testing/TC_CNET_4_4.py @@ -22,7 +22,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_DA_1_2.py b/src/python_testing/TC_DA_1_2.py index 9bf08fe72afdf0..9fa60cd8bf31a8 100644 --- a/src/python_testing/TC_DA_1_2.py +++ b/src/python_testing/TC_DA_1_2.py @@ -40,10 +40,8 @@ import re import chip.clusters as Clusters +from basic_composition_support import BasicCompositionTests from chip.interaction_model import InteractionModelError, Status -from chip.testing.basic_composition import BasicCompositionTests -from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, hex_from_bytes, - type_matches) from chip.tlv import TLVReader from cryptography import x509 from cryptography.exceptions import InvalidSignature @@ -51,6 +49,7 @@ from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, utils from ecdsa.curves import curve_by_name +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from mobly import asserts from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.error import PyAsn1Error diff --git a/src/python_testing/TC_DA_1_5.py b/src/python_testing/TC_DA_1_5.py index e8e6ce773c6fec..c08f4eb4ef2a65 100644 --- a/src/python_testing/TC_DA_1_5.py +++ b/src/python_testing/TC_DA_1_5.py @@ -40,12 +40,12 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from chip.tlv import TLVReader from cryptography import x509 from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, utils from ecdsa.curves import curve_by_name +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from mobly import asserts from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.error import PyAsn1Error diff --git a/src/python_testing/TC_DA_1_7.py b/src/python_testing/TC_DA_1_7.py index 6678080a600d6b..1130a7b423d8bd 100644 --- a/src/python_testing/TC_DA_1_7.py +++ b/src/python_testing/TC_DA_1_7.py @@ -41,13 +41,13 @@ from typing import List, Optional import chip.clusters as Clusters -from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex, default_matter_test_main, - hex_from_bytes) from cryptography.exceptions import InvalidSignature from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat from cryptography.x509 import AuthorityKeyIdentifier, Certificate, SubjectKeyIdentifier, load_der_x509_certificate +from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex, default_matter_test_main, + hex_from_bytes) from mobly import asserts # Those are SDK samples that are known to be non-production. diff --git a/src/python_testing/TC_DEMTestBase.py b/src/python_testing/TC_DEMTestBase.py index 49c8c6a6375a3e..da51ba252820cc 100644 --- a/src/python_testing/TC_DEMTestBase.py +++ b/src/python_testing/TC_DEMTestBase.py @@ -19,7 +19,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import utc_time_in_matter_epoch +from matter_testing_support import utc_time_in_matter_epoch from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DEM_2_1.py b/src/python_testing/TC_DEM_2_1.py index 851099cb8ec8e2..4975d3ae296609 100644 --- a/src/python_testing/TC_DEM_2_1.py +++ b/src/python_testing/TC_DEM_2_1.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_10.py b/src/python_testing/TC_DEM_2_10.py index 810efdbfa25362..8f2e0baf35b9b6 100644 --- a/src/python_testing/TC_DEM_2_10.py +++ b/src/python_testing/TC_DEM_2_10.py @@ -50,8 +50,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) +from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_2.py b/src/python_testing/TC_DEM_2_2.py index 168417dd984856..b5e26e4336a6e3 100644 --- a/src/python_testing/TC_DEM_2_2.py +++ b/src/python_testing/TC_DEM_2_2.py @@ -52,7 +52,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_3.py b/src/python_testing/TC_DEM_2_3.py index c5699c03184a81..25398b41eadfbf 100644 --- a/src/python_testing/TC_DEM_2_3.py +++ b/src/python_testing/TC_DEM_2_3.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_4.py b/src/python_testing/TC_DEM_2_4.py index 1b591cd438c3fc..6a396fc3a3153f 100644 --- a/src/python_testing/TC_DEM_2_4.py +++ b/src/python_testing/TC_DEM_2_4.py @@ -47,7 +47,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_5.py b/src/python_testing/TC_DEM_2_5.py index c845ec199734d5..f7f7d75d53fd8a 100644 --- a/src/python_testing/TC_DEM_2_5.py +++ b/src/python_testing/TC_DEM_2_5.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_6.py b/src/python_testing/TC_DEM_2_6.py index 32dea4af4fc754..2e2a96f92be941 100644 --- a/src/python_testing/TC_DEM_2_6.py +++ b/src/python_testing/TC_DEM_2_6.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_7.py b/src/python_testing/TC_DEM_2_7.py index 44c65fbc58ac15..36e7ab984ae094 100644 --- a/src/python_testing/TC_DEM_2_7.py +++ b/src/python_testing/TC_DEM_2_7.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_8.py b/src/python_testing/TC_DEM_2_8.py index 016778fdf1d0bd..1f3d240b22c611 100644 --- a/src/python_testing/TC_DEM_2_8.py +++ b/src/python_testing/TC_DEM_2_8.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_9.py b/src/python_testing/TC_DEM_2_9.py index 05111e3b8f9c89..4541b9cc6e06a9 100644 --- a/src/python_testing/TC_DEM_2_9.py +++ b/src/python_testing/TC_DEM_2_9.py @@ -48,7 +48,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DGGEN_2_4.py b/src/python_testing/TC_DGGEN_2_4.py index 17b068452cdae6..27542e651d4699 100644 --- a/src/python_testing/TC_DGGEN_2_4.py +++ b/src/python_testing/TC_DGGEN_2_4.py @@ -40,9 +40,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, default_matter_test_main, - matter_epoch_us_from_utc_datetime, utc_datetime_from_matter_epoch_us, - utc_datetime_from_posix_time_ms) +from matter_testing_support import (MatterBaseTest, async_test_body, default_matter_test_main, matter_epoch_us_from_utc_datetime, + utc_datetime_from_matter_epoch_us, utc_datetime_from_posix_time_ms) from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DGGEN_3_2.py b/src/python_testing/TC_DGGEN_3_2.py index 58c333e8b4e6b0..7e5af6c7a5ea73 100644 --- a/src/python_testing/TC_DGGEN_3_2.py +++ b/src/python_testing/TC_DGGEN_3_2.py @@ -16,7 +16,7 @@ # import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_DGSW_2_1.py b/src/python_testing/TC_DGSW_2_1.py index 633893272598d5..46ed696da919c0 100644 --- a/src/python_testing/TC_DGSW_2_1.py +++ b/src/python_testing/TC_DGSW_2_1.py @@ -36,7 +36,7 @@ # import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_DRLK_2_12.py b/src/python_testing/TC_DRLK_2_12.py index 342fbc64f61c10..cf63bd810a0622 100644 --- a/src/python_testing/TC_DRLK_2_12.py +++ b/src/python_testing/TC_DRLK_2_12.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_13.py b/src/python_testing/TC_DRLK_2_13.py index 809e2785170ab2..dc1b69da2272f9 100644 --- a/src/python_testing/TC_DRLK_2_13.py +++ b/src/python_testing/TC_DRLK_2_13.py @@ -43,7 +43,7 @@ from chip.clusters.Attribute import EventPriority from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DRLK_2_2.py b/src/python_testing/TC_DRLK_2_2.py index f9f192f18ea6ae..84a511b98ded98 100644 --- a/src/python_testing/TC_DRLK_2_2.py +++ b/src/python_testing/TC_DRLK_2_2.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_3.py b/src/python_testing/TC_DRLK_2_3.py index 114f41ab9c651b..75690865cf6d8e 100644 --- a/src/python_testing/TC_DRLK_2_3.py +++ b/src/python_testing/TC_DRLK_2_3.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_5.py b/src/python_testing/TC_DRLK_2_5.py index 84451d26002c28..defe78eafdab72 100644 --- a/src/python_testing/TC_DRLK_2_5.py +++ b/src/python_testing/TC_DRLK_2_5.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DRLK_2_9.py b/src/python_testing/TC_DRLK_2_9.py index fb294b724f9e82..b92eaf42b5f318 100644 --- a/src/python_testing/TC_DRLK_2_9.py +++ b/src/python_testing/TC_DRLK_2_9.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from drlk_2_x_common import DRLK_COMMON +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index e0e9d86320302a..9ff05d4ab0d68f 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -103,19 +103,19 @@ import chip.clusters as Clusters import chip.clusters.ClusterObjects import chip.tlv +from basic_composition_support import BasicCompositionTests from chip import ChipUtility from chip.clusters.Attribute import ValueDecodeFailure from chip.clusters.ClusterObjects import ClusterAttributeDescriptor, ClusterObjectFieldDescriptor from chip.interaction_model import InteractionModelError, Status -from chip.testing.basic_composition import BasicCompositionTests -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, - async_test_body, default_matter_test_main) -from chip.testing.taglist_and_topology_test import (create_device_type_list_for_root, create_device_type_lists, - find_tag_list_problems, find_tree_roots, flat_list_ok, - get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) from chip.tlv import uint +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, + async_test_body, default_matter_test_main) from mobly import asserts +from taglist_and_topology_test_support import (create_device_type_list_for_root, create_device_type_lists, find_tag_list_problems, + find_tree_roots, flat_list_ok, get_direct_children_of_root, parts_list_cycles, + separate_endpoint_types) def check_int_in_range(min_value: int, max_value: int, allow_null: bool = False) -> Callable: @@ -511,14 +511,12 @@ class RequiredMandatoryAttribute: attribute_id=manufacturer_value) if suffix > attribute_standard_range_max and suffix < global_range_min: self.record_error(self.get_test_name(), location=location, - problem=f"Manufacturer attribute in undefined range { - manufacturer_value} in cluster {cluster_id}", + problem=f"Manufacturer attribute in undefined range {manufacturer_value} in cluster {cluster_id}", spec_location=f"Cluster {cluster_id}") success = False elif suffix >= global_range_min: self.record_error(self.get_test_name(), location=location, - problem=f"Manufacturer attribute in global range { - manufacturer_value} in cluster {cluster_id}", + problem=f"Manufacturer attribute in global range {manufacturer_value} in cluster {cluster_id}", spec_location=f"Cluster {cluster_id}") success = False @@ -815,8 +813,7 @@ def test_TC_DESC_2_2(self): for ep, problem in problems.items(): location = AttributePathLocation(endpoint_id=ep, cluster_id=Clusters.Descriptor.id, attribute_id=Clusters.Descriptor.Attributes.TagList.attribute_id) - msg = f'problem on ep {ep}: missing feature = {problem.missing_feature}, missing attribute = { - problem.missing_attribute}, duplicates = {problem.duplicates}, same_tags = {problem.same_tag}' + msg = f'problem on ep {ep}: missing feature = {problem.missing_feature}, missing attribute = {problem.missing_attribute}, duplicates = {problem.duplicates}, same_tags = {problem.same_tag}' self.record_error(self.get_test_name(), location=location, problem=msg, spec_location="Descriptor TagList") self.print_step(2, "Identify all the direct children of the root node endpoint") diff --git a/src/python_testing/TC_DeviceConformance.py b/src/python_testing/TC_DeviceConformance.py index a3e350bdfb76c7..8e700b49ab61f0 100644 --- a/src/python_testing/TC_DeviceConformance.py +++ b/src/python_testing/TC_DeviceConformance.py @@ -39,16 +39,16 @@ from typing import Callable import chip.clusters as Clusters -from chip.testing.basic_composition import BasicCompositionTests -from chip.testing.choice_conformance import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, - evaluate_feature_choice_conformance) -from chip.testing.conformance import ConformanceDecision, conformance_allowed -from chip.testing.global_attribute_ids import (ClusterIdType, DeviceTypeIdType, GlobalAttributeIds, cluster_id_type, - device_type_id_type, is_valid_device_type_id) -from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, - MatterBaseTest, ProblemNotice, ProblemSeverity, async_test_body, default_matter_test_main) -from chip.testing.spec_parsing import CommandType, build_xml_clusters, build_xml_device_types +from basic_composition_support import BasicCompositionTests from chip.tlv import uint +from choice_conformance_support import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, + evaluate_feature_choice_conformance) +from conformance_support import ConformanceDecision, conformance_allowed +from global_attribute_ids import (ClusterIdType, DeviceTypeIdType, GlobalAttributeIds, cluster_id_type, device_type_id_type, + is_valid_device_type_id) +from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, + MatterBaseTest, ProblemNotice, ProblemSeverity, async_test_body, default_matter_test_main) +from spec_parsing_support import CommandType, build_xml_clusters, build_xml_device_types class DeviceConformanceTests(BasicCompositionTests): diff --git a/src/python_testing/TC_ECOINFO_2_1.py b/src/python_testing/TC_ECOINFO_2_1.py index a0adf75ac4b8e2..1cb6ec203a703c 100644 --- a/src/python_testing/TC_ECOINFO_2_1.py +++ b/src/python_testing/TC_ECOINFO_2_1.py @@ -47,8 +47,8 @@ from chip.clusters.Types import NullValue from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from chip.tlv import uint +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_ECOINFO_2_2.py b/src/python_testing/TC_ECOINFO_2_2.py index 403544bf4fcc6b..85868a94683ab9 100644 --- a/src/python_testing/TC_ECOINFO_2_2.py +++ b/src/python_testing/TC_ECOINFO_2_2.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts _DEVICE_TYPE_AGGREGGATOR = 0x000E diff --git a/src/python_testing/TC_EEM_2_1.py b/src/python_testing/TC_EEM_2_1.py index 653bd942a949e3..0b6b4809a489d4 100644 --- a/src/python_testing/TC_EEM_2_1.py +++ b/src/python_testing/TC_EEM_2_1.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_2.py b/src/python_testing/TC_EEM_2_2.py index 408cd85adb60d7..6058aa34c50431 100644 --- a/src/python_testing/TC_EEM_2_2.py +++ b/src/python_testing/TC_EEM_2_2.py @@ -41,7 +41,7 @@ import time -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_3.py b/src/python_testing/TC_EEM_2_3.py index 69a41b08e034a9..6e8bd7d9f532b7 100644 --- a/src/python_testing/TC_EEM_2_3.py +++ b/src/python_testing/TC_EEM_2_3.py @@ -41,7 +41,7 @@ import time -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_4.py b/src/python_testing/TC_EEM_2_4.py index 0f67fb04053ac6..fb5d5f6b362cb7 100644 --- a/src/python_testing/TC_EEM_2_4.py +++ b/src/python_testing/TC_EEM_2_4.py @@ -41,7 +41,7 @@ import time -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_5.py b/src/python_testing/TC_EEM_2_5.py index 43cb2cddf8d122..1408e2b9f631b7 100644 --- a/src/python_testing/TC_EEM_2_5.py +++ b/src/python_testing/TC_EEM_2_5.py @@ -41,7 +41,7 @@ import time -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index 144bfd82d38037..61e52ed0bee62d 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_3.py b/src/python_testing/TC_EEVSE_2_3.py index 6494f4a7f17c63..92005f345bb21a 100644 --- a/src/python_testing/TC_EEVSE_2_3.py +++ b/src/python_testing/TC_EEVSE_2_3.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper @@ -191,7 +191,7 @@ def compute_expected_target_time_as_epoch_s(self, minutes_past_midnight): logger.info( f"minutesPastMidnight = {minutes_past_midnight} => " - f"{int(minutes_past_midnight/60)}:{int(minutes_past_midnight % 60)}" + f"{int(minutes_past_midnight/60)}:{int(minutes_past_midnight%60)}" f" Expected target_time = {target_time}") target_time_delta = target_time - \ diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index 10355debd0543b..aaebf642b1fcfa 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -45,7 +45,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_EEVSE_Utils import EEVSEBaseTestHelper logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 4571cfb36305f2..b25cfe16ce3b09 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -45,7 +45,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_EEVSE_Utils import EEVSEBaseTestHelper logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_6.py b/src/python_testing/TC_EEVSE_2_6.py index d66ff60bf6304b..8f809b4adaecd2 100644 --- a/src/python_testing/TC_EEVSE_2_6.py +++ b/src/python_testing/TC_EEVSE_2_6.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, - async_test_body, default_matter_test_main) +from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, + async_test_body, default_matter_test_main) from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EPM_2_1.py b/src/python_testing/TC_EPM_2_1.py index 0f3c74e66248f3..f12cafea666617 100644 --- a/src/python_testing/TC_EPM_2_1.py +++ b/src/python_testing/TC_EPM_2_1.py @@ -42,7 +42,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper @@ -148,8 +148,7 @@ async def test_TC_EPM_2_1(self): "minMeasuredValue must be the same as 1st accuracyRange rangeMin") for index, range_entry in enumerate(measurement.accuracyRanges): - logging.info(f" [{index}] rangeMin: {range_entry.rangeMin} rangeMax: {range_entry.rangeMax} percentMax: {range_entry.percentMax} percentMin: { - range_entry.percentMin} percentTypical: {range_entry.percentTypical} fixedMax: {range_entry.fixedMax} fixedMin: {range_entry.fixedMin} fixedTypical: {range_entry.fixedTypical}") + logging.info(f" [{index}] rangeMin:{range_entry.rangeMin} rangeMax:{range_entry.rangeMax} percentMax:{range_entry.percentMax} percentMin:{range_entry.percentMin} percentTypical:{range_entry.percentTypical} fixedMax:{range_entry.fixedMax} fixedMin:{range_entry.fixedMin} fixedTypical:{range_entry.fixedTypical}") asserts.assert_greater( range_entry.rangeMax, range_entry.rangeMin, "rangeMax should be > rangeMin") if index == 0: diff --git a/src/python_testing/TC_EPM_2_2.py b/src/python_testing/TC_EPM_2_2.py index d817042753c251..97e9e047d24ca7 100644 --- a/src/python_testing/TC_EPM_2_2.py +++ b/src/python_testing/TC_EPM_2_2.py @@ -42,7 +42,7 @@ import logging import time -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EWATERHTR_2_1.py b/src/python_testing/TC_EWATERHTR_2_1.py index 82c9e93dad0414..ced3b16b3d6a45 100644 --- a/src/python_testing/TC_EWATERHTR_2_1.py +++ b/src/python_testing/TC_EWATERHTR_2_1.py @@ -45,7 +45,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_EWATERHTR_2_2.py b/src/python_testing/TC_EWATERHTR_2_2.py index 1bd7185b1f6e60..11e8d545b542d1 100644 --- a/src/python_testing/TC_EWATERHTR_2_2.py +++ b/src/python_testing/TC_EWATERHTR_2_2.py @@ -47,7 +47,7 @@ import time import chip.clusters as Clusters -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_EWATERHTR_2_3.py b/src/python_testing/TC_EWATERHTR_2_3.py index 0f1c3deae690f3..5f7df8c160b410 100644 --- a/src/python_testing/TC_EWATERHTR_2_3.py +++ b/src/python_testing/TC_EWATERHTR_2_3.py @@ -45,7 +45,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_FAN_3_1.py b/src/python_testing/TC_FAN_3_1.py index 483be894ba11ed..f8322506e65294 100644 --- a/src/python_testing/TC_FAN_3_1.py +++ b/src/python_testing/TC_FAN_3_1.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_2.py b/src/python_testing/TC_FAN_3_2.py index 799510eeeadf32..736c97096ef22c 100644 --- a/src/python_testing/TC_FAN_3_2.py +++ b/src/python_testing/TC_FAN_3_2.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_3.py b/src/python_testing/TC_FAN_3_3.py index 7a4dde3f6cb983..935811de21f2e1 100644 --- a/src/python_testing/TC_FAN_3_3.py +++ b/src/python_testing/TC_FAN_3_3.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_4.py b/src/python_testing/TC_FAN_3_4.py index 989680ed6b8e0a..722339357b3e66 100644 --- a/src/python_testing/TC_FAN_3_4.py +++ b/src/python_testing/TC_FAN_3_4.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # import time diff --git a/src/python_testing/TC_FAN_3_5.py b/src/python_testing/TC_FAN_3_5.py index 26dfc3e52f8f22..d03f99e55fef12 100644 --- a/src/python_testing/TC_FAN_3_5.py +++ b/src/python_testing/TC_FAN_3_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_2_1.py b/src/python_testing/TC_ICDM_2_1.py index 8d7f6d5ed876ec..35d1cb62c0949d 100644 --- a/src/python_testing/TC_ICDM_2_1.py +++ b/src/python_testing/TC_ICDM_2_1.py @@ -39,7 +39,7 @@ import re import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_1.py b/src/python_testing/TC_ICDM_3_1.py index 58181a6588205f..d46d72553d89a9 100644 --- a/src/python_testing/TC_ICDM_3_1.py +++ b/src/python_testing/TC_ICDM_3_1.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_2.py b/src/python_testing/TC_ICDM_3_2.py index d9800d65b7ceac..924c6f4a017d9d 100644 --- a/src/python_testing/TC_ICDM_3_2.py +++ b/src/python_testing/TC_ICDM_3_2.py @@ -42,7 +42,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_3.py b/src/python_testing/TC_ICDM_3_3.py index d261e539047c35..bc1d6980711661 100644 --- a/src/python_testing/TC_ICDM_3_3.py +++ b/src/python_testing/TC_ICDM_3_3.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_4.py b/src/python_testing/TC_ICDM_3_4.py index 8ff2a570376505..4ebb32525cbb62 100644 --- a/src/python_testing/TC_ICDM_3_4.py +++ b/src/python_testing/TC_ICDM_3_4.py @@ -40,8 +40,8 @@ import time import chip.clusters as Clusters -from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - default_matter_test_main) +from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_5_1.py b/src/python_testing/TC_ICDM_5_1.py index dacfe58c8b6923..4b7222b69033eb 100644 --- a/src/python_testing/TC_ICDM_5_1.py +++ b/src/python_testing/TC_ICDM_5_1.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mdns_discovery import mdns_discovery from mobly import asserts diff --git a/src/python_testing/TC_ICDManagementCluster.py b/src/python_testing/TC_ICDManagementCluster.py index c0437cb8096537..07c889a6ea44d6 100644 --- a/src/python_testing/TC_ICDManagementCluster.py +++ b/src/python_testing/TC_ICDManagementCluster.py @@ -42,7 +42,7 @@ from enum import IntEnum import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Assumes `--enable-key 000102030405060708090a0b0c0d0e0f` on Linux app command line, or a DUT diff --git a/src/python_testing/TC_IDM_1_2.py b/src/python_testing/TC_IDM_1_2.py index a1db9bac83cedd..7bfb97c22eea1f 100644 --- a/src/python_testing/TC_IDM_1_2.py +++ b/src/python_testing/TC_IDM_1_2.py @@ -44,7 +44,7 @@ from chip import ChipUtility from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_IDM_1_4.py b/src/python_testing/TC_IDM_1_4.py index 74194135de80f7..b00de41f370b64 100644 --- a/src/python_testing/TC_IDM_1_4.py +++ b/src/python_testing/TC_IDM_1_4.py @@ -44,7 +44,7 @@ import chip.clusters as Clusters from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts # If DUT supports `MaxPathsPerInvoke > 1`, additional command line argument diff --git a/src/python_testing/TC_IDM_4_2.py b/src/python_testing/TC_IDM_4_2.py index 0f4cd513e3341a..d9e876bcd04761 100644 --- a/src/python_testing/TC_IDM_4_2.py +++ b/src/python_testing/TC_IDM_4_2.py @@ -44,7 +44,7 @@ from chip.clusters.Attribute import AttributePath, TypedAttributePath from chip.exceptions import ChipStackError from chip.interaction_model import Status -from chip.testing.matter_testing import AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts ''' diff --git a/src/python_testing/TC_LVL_2_3.py b/src/python_testing/TC_LVL_2_3.py index d120bb7169c17d..94c33d58c022a1 100644 --- a/src/python_testing/TC_LVL_2_3.py +++ b/src/python_testing/TC_LVL_2_3.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters import test_plan_support -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, - has_cluster, run_if_endpoint_matches) +from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, + has_cluster, run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index 995a80cd941289..a04cbf0cdeaf4c 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -48,7 +48,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts _DEVICE_TYPE_AGGREGATOR = 0x000E diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index f806db4d0921e6..a7d318ca658e28 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -51,8 +51,8 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from ecdsa.curves import NIST256p +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts from TC_SC_3_6 import AttributeChangeAccumulator diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py index 2ac1556199a0c7..c0b3e83fe39629 100644 --- a/src/python_testing/TC_MCORE_FS_1_3.py +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -51,7 +51,7 @@ from chip import ChipDeviceCtrl from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts _DEVICE_TYPE_AGGREGATOR = 0x000E diff --git a/src/python_testing/TC_MCORE_FS_1_4.py b/src/python_testing/TC_MCORE_FS_1_4.py index 795e81cf2f274d..74a8becdf77d40 100644 --- a/src/python_testing/TC_MCORE_FS_1_4.py +++ b/src/python_testing/TC_MCORE_FS_1_4.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from chip.testing.tasks import Subprocess +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_MCORE_FS_1_5.py b/src/python_testing/TC_MCORE_FS_1_5.py index 59549fd0bcdc9b..57ae214a5d81ea 100755 --- a/src/python_testing/TC_MCORE_FS_1_5.py +++ b/src/python_testing/TC_MCORE_FS_1_5.py @@ -51,8 +51,8 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from ecdsa.curves import NIST256p +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts from TC_SC_3_6 import AttributeChangeAccumulator diff --git a/src/python_testing/TC_MWOCTRL_2_1.py b/src/python_testing/TC_MWOCTRL_2_1.py index 6f913578cbcb9a..57c51fa98d7c02 100644 --- a/src/python_testing/TC_MWOCTRL_2_1.py +++ b/src/python_testing/TC_MWOCTRL_2_1.py @@ -37,7 +37,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOCTRL_2_2.py b/src/python_testing/TC_MWOCTRL_2_2.py index 45596896405b98..35eef081a93fbc 100644 --- a/src/python_testing/TC_MWOCTRL_2_2.py +++ b/src/python_testing/TC_MWOCTRL_2_2.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOCTRL_2_4.py b/src/python_testing/TC_MWOCTRL_2_4.py index e05c4a5bd5056c..9e117249752e03 100644 --- a/src/python_testing/TC_MWOCTRL_2_4.py +++ b/src/python_testing/TC_MWOCTRL_2_4.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOM_1_2.py b/src/python_testing/TC_MWOM_1_2.py index 5cad6ce013fed6..8a7762337e6bca 100644 --- a/src/python_testing/TC_MWOM_1_2.py +++ b/src/python_testing/TC_MWOM_1_2.py @@ -37,7 +37,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_1.py b/src/python_testing/TC_OCC_2_1.py index d831d486d27bd2..885ec6b16c0720 100644 --- a/src/python_testing/TC_OCC_2_1.py +++ b/src/python_testing/TC_OCC_2_1.py @@ -43,7 +43,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_2.py b/src/python_testing/TC_OCC_2_2.py index bf5e97ea5e9d0c..463b8136d50f5f 100644 --- a/src/python_testing/TC_OCC_2_2.py +++ b/src/python_testing/TC_OCC_2_2.py @@ -37,7 +37,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts @@ -133,8 +133,7 @@ async def test_TC_OCC_2_2(self): asserts.assert_equal( (occupancy_sensor_type_bitmap_dut & sensor_bit) != 0, (feature_map & feature_bit) != 0, - f"Feature bit and sensor bitmap must be equal for { - name}(BITMAP: 0x{occupancy_sensor_type_bitmap_dut: 02X}, FEATUREMAP: 0x{feature_map: 02X})" + f"Feature bit and sensor bitmap must be equal for {name} (BITMAP: 0x{occupancy_sensor_type_bitmap_dut:02X}, FEATUREMAP: 0x{feature_map:02X})" ) diff --git a/src/python_testing/TC_OCC_2_3.py b/src/python_testing/TC_OCC_2_3.py index 8d4b53f4292c24..9c6cb80d9a2ed5 100644 --- a/src/python_testing/TC_OCC_2_3.py +++ b/src/python_testing/TC_OCC_2_3.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_3_1.py b/src/python_testing/TC_OCC_3_1.py index cce0a2f697a8d7..b6ba0ead011199 100644 --- a/src/python_testing/TC_OCC_3_1.py +++ b/src/python_testing/TC_OCC_3_1.py @@ -43,8 +43,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, - async_test_body, await_sequence_of_reports, default_matter_test_main) +from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, + async_test_body, await_sequence_of_reports, default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_OCC_3_2.py b/src/python_testing/TC_OCC_3_2.py index 3a5ca170694138..d4e5f186621a62 100644 --- a/src/python_testing/TC_OCC_3_2.py +++ b/src/python_testing/TC_OCC_3_2.py @@ -44,8 +44,8 @@ import time import chip.clusters as Clusters -from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, - async_test_body, await_sequence_of_reports, default_matter_test_main) +from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + await_sequence_of_reports, default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_OPCREDS_3_1.py b/src/python_testing/TC_OPCREDS_3_1.py index 1506d2a7125f96..be21c6d7d43272 100644 --- a/src/python_testing/TC_OPCREDS_3_1.py +++ b/src/python_testing/TC_OPCREDS_3_1.py @@ -42,8 +42,8 @@ from chip import ChipDeviceCtrl from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.tlv import TLVReader, TLVWriter +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OPCREDS_3_2.py b/src/python_testing/TC_OPCREDS_3_2.py index 2bfc214665defd..91e2958fb0030e 100644 --- a/src/python_testing/TC_OPCREDS_3_2.py +++ b/src/python_testing/TC_OPCREDS_3_2.py @@ -36,9 +36,9 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from chip.tlv import TLVReader from chip.utils import CommissioningBuildingBlocks +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from test_plan_support import (commission_from_existing, commission_if_required, read_attribute, remove_fabric, verify_commissioning_successful, verify_success) diff --git a/src/python_testing/TC_OPSTATE_2_1.py b/src/python_testing/TC_OPSTATE_2_1.py index 060b71d85ee550..1b6966a09ab4bc 100644 --- a/src/python_testing/TC_OPSTATE_2_1.py +++ b/src/python_testing/TC_OPSTATE_2_1.py @@ -37,7 +37,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_2.py b/src/python_testing/TC_OPSTATE_2_2.py index f0ed8f214d421a..8617d3ddd6e101 100644 --- a/src/python_testing/TC_OPSTATE_2_2.py +++ b/src/python_testing/TC_OPSTATE_2_2.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_3.py b/src/python_testing/TC_OPSTATE_2_3.py index d35aa6e61e4af7..3671747dee1b3f 100644 --- a/src/python_testing/TC_OPSTATE_2_3.py +++ b/src/python_testing/TC_OPSTATE_2_3.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_4.py b/src/python_testing/TC_OPSTATE_2_4.py index ec2c7c17daf098..d468227781b4c7 100644 --- a/src/python_testing/TC_OPSTATE_2_4.py +++ b/src/python_testing/TC_OPSTATE_2_4.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_5.py b/src/python_testing/TC_OPSTATE_2_5.py index 89a2462a2bf917..687f4d21b060eb 100644 --- a/src/python_testing/TC_OPSTATE_2_5.py +++ b/src/python_testing/TC_OPSTATE_2_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_6.py b/src/python_testing/TC_OPSTATE_2_6.py index 0b9e1ec3bb067a..9441569c874517 100644 --- a/src/python_testing/TC_OPSTATE_2_6.py +++ b/src/python_testing/TC_OPSTATE_2_6.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_1.py b/src/python_testing/TC_OVENOPSTATE_2_1.py index d830a416c0911a..6bf7226986f270 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_1.py +++ b/src/python_testing/TC_OVENOPSTATE_2_1.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_2.py b/src/python_testing/TC_OVENOPSTATE_2_2.py index 55afad11bebe88..2fa1215bd1a9d4 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_2.py +++ b/src/python_testing/TC_OVENOPSTATE_2_2.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_3.py b/src/python_testing/TC_OVENOPSTATE_2_3.py index 329bceb1fb1cb5..815fcef97b0a42 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_3.py +++ b/src/python_testing/TC_OVENOPSTATE_2_3.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_4.py b/src/python_testing/TC_OVENOPSTATE_2_4.py index ffc639390ee3de..892bf28f0d3d1a 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_4.py +++ b/src/python_testing/TC_OVENOPSTATE_2_4.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_5.py b/src/python_testing/TC_OVENOPSTATE_2_5.py index 42edca72f39515..4fd9ef92717e3e 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_5.py +++ b/src/python_testing/TC_OVENOPSTATE_2_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_6.py b/src/python_testing/TC_OVENOPSTATE_2_6.py index 2770625bb707fa..db4b390027a9a6 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_6.py +++ b/src/python_testing/TC_OVENOPSTATE_2_6.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OpstateCommon.py b/src/python_testing/TC_OpstateCommon.py index 557b7606ccbea3..c697c7ab5f5be5 100644 --- a/src/python_testing/TC_OpstateCommon.py +++ b/src/python_testing/TC_OpstateCommon.py @@ -27,7 +27,7 @@ from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import ClusterAttributeChangeAccumulator, EventChangeCallback, TestStep +from matter_testing_support import ClusterAttributeChangeAccumulator, EventChangeCallback, TestStep from mobly import asserts diff --git a/src/python_testing/TC_PS_2_3.py b/src/python_testing/TC_PS_2_3.py index 13f4420b0a24ad..dbff20e6f45ffd 100644 --- a/src/python_testing/TC_PS_2_3.py +++ b/src/python_testing/TC_PS_2_3.py @@ -38,8 +38,8 @@ import time import chip.clusters as Clusters -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) +from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_PWRTL_2_1.py b/src/python_testing/TC_PWRTL_2_1.py index 3de09c6e9356dc..639bd3dd9a2de2 100644 --- a/src/python_testing/TC_PWRTL_2_1.py +++ b/src/python_testing/TC_PWRTL_2_1.py @@ -37,7 +37,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RR_1_1.py b/src/python_testing/TC_RR_1_1.py index 0cbf0274c5977b..2785171f9412f4 100644 --- a/src/python_testing/TC_RR_1_1.py +++ b/src/python_testing/TC_RR_1_1.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status as StatusEnum -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.utils import CommissioningBuildingBlocks +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts from TC_SC_3_6 import AttributeChangeAccumulator, ResubscriptionCatcher diff --git a/src/python_testing/TC_RVCCLEANM_1_2.py b/src/python_testing/TC_RVCCLEANM_1_2.py index 3dfd75f4f43897..9e4bca47626543 100644 --- a/src/python_testing/TC_RVCCLEANM_1_2.py +++ b/src/python_testing/TC_RVCCLEANM_1_2.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 5234a74685c34e..2c4ddd1dc74861 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 7352d03e241a91..52624655554a7b 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -39,7 +39,7 @@ import enum import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_1.py b/src/python_testing/TC_RVCOPSTATE_2_1.py index 48715c3b7a5aa9..ae3e6c393085b6 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_1.py +++ b/src/python_testing/TC_RVCOPSTATE_2_1.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_3.py b/src/python_testing/TC_RVCOPSTATE_2_3.py index 1b522117b9ea6f..60bbed18bd1908 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_3.py +++ b/src/python_testing/TC_RVCOPSTATE_2_3.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_4.py b/src/python_testing/TC_RVCOPSTATE_2_4.py index ad515dbff1983a..458b3cf740170b 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_4.py +++ b/src/python_testing/TC_RVCOPSTATE_2_4.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCRUNM_1_2.py b/src/python_testing/TC_RVCRUNM_1_2.py index 90db1601b1375a..d3040fdb6be570 100644 --- a/src/python_testing/TC_RVCRUNM_1_2.py +++ b/src/python_testing/TC_RVCRUNM_1_2.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 55c37c70945571..850faf052adf24 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index e78d6d7f427c7e..f53a75503b5ace 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -41,7 +41,7 @@ import enum import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments. diff --git a/src/python_testing/TC_SC_3_6.py b/src/python_testing/TC_SC_3_6.py index 8cfbee8e46a8fa..74c09e2b72f02c 100644 --- a/src/python_testing/TC_SC_3_6.py +++ b/src/python_testing/TC_SC_3_6.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.clusters import ClusterObjects as ClustersObjects from chip.clusters.Attribute import SubscriptionTransaction, TypedAttributePath -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.utils import CommissioningBuildingBlocks +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # TODO: Overall, we need to add validation that session IDs have not changed throughout to be agnostic diff --git a/src/python_testing/TC_SC_7_1.py b/src/python_testing/TC_SC_7_1.py index 315790e9802726..19229b38ec2afe 100644 --- a/src/python_testing/TC_SC_7_1.py +++ b/src/python_testing/TC_SC_7_1.py @@ -38,13 +38,12 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts def _trusted_root_test_step(dut_num: int) -> TestStep: - read_trusted_roots_over_pase = f'TH establishes a PASE session to DUT{ - dut_num} using the provided setup code and reads the TrustedRootCertificates attribute from the operational credentials cluster over PASE' + read_trusted_roots_over_pase = f'TH establishes a PASE session to DUT{dut_num} using the provided setup code and reads the TrustedRootCertificates attribute from the operational credentials cluster over PASE' return TestStep(dut_num, read_trusted_roots_over_pase, "List should be empty as the DUT should be in factory reset ") diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index 41773804e45d75..41482be51c356f 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_3.py b/src/python_testing/TC_SEAR_1_3.py index b55e21d88498bd..9592bce3fe90e5 100644 --- a/src/python_testing/TC_SEAR_1_3.py +++ b/src/python_testing/TC_SEAR_1_3.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts @@ -139,8 +139,7 @@ async def test_TC_SEAR_1_3(self): await self.send_cmd_select_areas_expect_response(step=9, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kInvalidInMode) if self.check_pics("SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL"): - test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({ - valid_areas}) command" + test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({valid_areas}) command" self.print_step("10", test_step) if self.is_ci: self.write_to_app_pipe({"Name": "Reset"}) @@ -156,8 +155,7 @@ async def test_TC_SEAR_1_3(self): await self.send_cmd_select_areas_expect_response(step=13, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kSuccess) if self.check_pics("SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL") and self.check_pics("SEAR.S.M.SELECT_AREAS_WHILE_NON_IDLE"): - test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({ - valid_areas}) command, and put the device in a non-idle state" + test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({valid_areas}) command, and put the device in a non-idle state" self.print_step("14", test_step) if self.is_ci: self.write_to_app_pipe({"Name": "Reset"}) diff --git a/src/python_testing/TC_SEAR_1_4.py b/src/python_testing/TC_SEAR_1_4.py index cf53f446f903c8..3f3a84bdf2d283 100644 --- a/src/python_testing/TC_SEAR_1_4.py +++ b/src/python_testing/TC_SEAR_1_4.py @@ -40,7 +40,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_5.py b/src/python_testing/TC_SEAR_1_5.py index 130ccb8d59fa3d..99da6da78b8547 100644 --- a/src/python_testing/TC_SEAR_1_5.py +++ b/src/python_testing/TC_SEAR_1_5.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_6.py b/src/python_testing/TC_SEAR_1_6.py index dc6188a14e92fa..434da0025824b6 100644 --- a/src/python_testing/TC_SEAR_1_6.py +++ b/src/python_testing/TC_SEAR_1_6.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SWTCH.py b/src/python_testing/TC_SWTCH.py index 3c764c6fe8c9bf..7cafaa7b5549fb 100644 --- a/src/python_testing/TC_SWTCH.py +++ b/src/python_testing/TC_SWTCH.py @@ -90,10 +90,10 @@ import test_plan_support from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import EventReadResult -from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, - TestStep, await_sequence_of_reports, default_matter_test_main, has_feature, - run_if_endpoint_matches) from chip.tlv import uint +from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, + TestStep, await_sequence_of_reports, default_matter_test_main, has_feature, + run_if_endpoint_matches) from mobly import asserts logger = logging.getLogger(__name__) @@ -281,8 +281,7 @@ def _expect_no_events_for_cluster(self, event_queue: queue.Queue, endpoint_id: i elapsed = 0.0 time_remaining = timeout_sec - logging.info(f"Waiting {timeout_sec: .1f} seconds for no more events for cluster { - expected_cluster} on endpoint {endpoint_id}") + logging.info(f"Waiting {timeout_sec:.1f} seconds for no more events for cluster {expected_cluster} on endpoint {endpoint_id}") while time_remaining > 0: try: item: EventReadResult = event_queue.get(block=True, timeout=time_remaining) diff --git a/src/python_testing/TC_TIMESYNC_2_1.py b/src/python_testing/TC_TIMESYNC_2_1.py index cb2df9d66a87e3..9858976520ce63 100644 --- a/src/python_testing/TC_TIMESYNC_2_1.py +++ b/src/python_testing/TC_TIMESYNC_2_1.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import (MatterBaseTest, default_matter_test_main, has_attribute, has_cluster, - run_if_endpoint_matches, utc_time_in_matter_epoch) +from matter_testing_support import (MatterBaseTest, default_matter_test_main, has_attribute, has_cluster, run_if_endpoint_matches, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_10.py b/src/python_testing/TC_TIMESYNC_2_10.py index 99ca9f3ac0194b..b9aa7dabb73c94 100644 --- a/src/python_testing/TC_TIMESYNC_2_10.py +++ b/src/python_testing/TC_TIMESYNC_2_10.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_11.py b/src/python_testing/TC_TIMESYNC_2_11.py index 0865bc87f4d1cc..1aaed7a14e36f4 100644 --- a/src/python_testing/TC_TIMESYNC_2_11.py +++ b/src/python_testing/TC_TIMESYNC_2_11.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_12.py b/src/python_testing/TC_TIMESYNC_2_12.py index 7677dcf184c0b2..cd4378fcdc1bfa 100644 --- a/src/python_testing/TC_TIMESYNC_2_12.py +++ b/src/python_testing/TC_TIMESYNC_2_12.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_13.py b/src/python_testing/TC_TIMESYNC_2_13.py index 81389830301a72..91c679e14be918 100644 --- a/src/python_testing/TC_TIMESYNC_2_13.py +++ b/src/python_testing/TC_TIMESYNC_2_13.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_2.py b/src/python_testing/TC_TIMESYNC_2_2.py index 74f935aac9714e..dff4bd5f82d445 100644 --- a/src/python_testing/TC_TIMESYNC_2_2.py +++ b/src/python_testing/TC_TIMESYNC_2_2.py @@ -40,8 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, - utc_time_in_matter_epoch) +from matter_testing_support import MatterBaseTest, async_test_body, compare_time, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_4.py b/src/python_testing/TC_TIMESYNC_2_4.py index 76fe9074bec56f..a367dcad3d84be 100644 --- a/src/python_testing/TC_TIMESYNC_2_4.py +++ b/src/python_testing/TC_TIMESYNC_2_4.py @@ -40,8 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches, utc_time_in_matter_epoch from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_5.py b/src/python_testing/TC_TIMESYNC_2_5.py index f363f03ba688d8..d62797e91e60dc 100644 --- a/src/python_testing/TC_TIMESYNC_2_5.py +++ b/src/python_testing/TC_TIMESYNC_2_5.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_6.py b/src/python_testing/TC_TIMESYNC_2_6.py index 0e9ec9f7957f42..f6fe8738f47972 100644 --- a/src/python_testing/TC_TIMESYNC_2_6.py +++ b/src/python_testing/TC_TIMESYNC_2_6.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import Nullable, NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_7.py b/src/python_testing/TC_TIMESYNC_2_7.py index 1c6cea2023d4de..edc71545cf2d42 100644 --- a/src/python_testing/TC_TIMESYNC_2_7.py +++ b/src/python_testing/TC_TIMESYNC_2_7.py @@ -42,9 +42,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_8.py b/src/python_testing/TC_TIMESYNC_2_8.py index 82a77c4c886d17..07785346c7539c 100644 --- a/src/python_testing/TC_TIMESYNC_2_8.py +++ b/src/python_testing/TC_TIMESYNC_2_8.py @@ -42,9 +42,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_9.py b/src/python_testing/TC_TIMESYNC_2_9.py index 4ce83f81ddbd4b..1f439b84e68779 100644 --- a/src/python_testing/TC_TIMESYNC_2_9.py +++ b/src/python_testing/TC_TIMESYNC_2_9.py @@ -41,9 +41,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_3_1.py b/src/python_testing/TC_TIMESYNC_3_1.py index 4c7c9d9420bad0..3f292d0e85fb27 100644 --- a/src/python_testing/TC_TIMESYNC_3_1.py +++ b/src/python_testing/TC_TIMESYNC_3_1.py @@ -35,7 +35,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TMP_2_1.py b/src/python_testing/TC_TMP_2_1.py index d0ae9cf86af2c0..f48b96991ef80d 100644 --- a/src/python_testing/TC_TMP_2_1.py +++ b/src/python_testing/TC_TMP_2_1.py @@ -16,7 +16,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TSTAT_4_2.py b/src/python_testing/TC_TSTAT_4_2.py index 6dad144f3050c4..fa77f94ae7dd69 100644 --- a/src/python_testing/TC_TSTAT_4_2.py +++ b/src/python_testing/TC_TSTAT_4_2.py @@ -43,7 +43,7 @@ from chip.clusters import Globals from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_TestEventTrigger.py b/src/python_testing/TC_TestEventTrigger.py index ae4f64a8059bb7..38053540c69413 100644 --- a/src/python_testing/TC_TestEventTrigger.py +++ b/src/python_testing/TC_TestEventTrigger.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Assumes `--enable-key 000102030405060708090a0b0c0d0e0f` on Linux app command line, or a DUT diff --git a/src/python_testing/TC_VALCC_2_1.py b/src/python_testing/TC_VALCC_2_1.py index d6f00b00a6c13b..a079c88c8be8ab 100644 --- a/src/python_testing/TC_VALCC_2_1.py +++ b/src/python_testing/TC_VALCC_2_1.py @@ -35,7 +35,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_1.py b/src/python_testing/TC_VALCC_3_1.py index 4b53ab032cc668..f4c6ebfa14d25f 100644 --- a/src/python_testing/TC_VALCC_3_1.py +++ b/src/python_testing/TC_VALCC_3_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_2.py b/src/python_testing/TC_VALCC_3_2.py index 6905e3bde8096f..0609051f4ef38f 100644 --- a/src/python_testing/TC_VALCC_3_2.py +++ b/src/python_testing/TC_VALCC_3_2.py @@ -37,7 +37,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_3.py b/src/python_testing/TC_VALCC_3_3.py index a63053cf346ea8..d90065d5bb34bb 100644 --- a/src/python_testing/TC_VALCC_3_3.py +++ b/src/python_testing/TC_VALCC_3_3.py @@ -37,7 +37,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_4.py b/src/python_testing/TC_VALCC_3_4.py index 30c57dcb3fa6dc..f1363a51f33c83 100644 --- a/src/python_testing/TC_VALCC_3_4.py +++ b/src/python_testing/TC_VALCC_3_4.py @@ -35,7 +35,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_1.py b/src/python_testing/TC_VALCC_4_1.py index 9af428d103674c..a103898567159c 100644 --- a/src/python_testing/TC_VALCC_4_1.py +++ b/src/python_testing/TC_VALCC_4_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_2.py b/src/python_testing/TC_VALCC_4_2.py index 9365e5bc780520..f2f0dd66314688 100644 --- a/src/python_testing/TC_VALCC_4_2.py +++ b/src/python_testing/TC_VALCC_4_2.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_3.py b/src/python_testing/TC_VALCC_4_3.py index b0762d0d88169c..a66d4eafd4fecc 100644 --- a/src/python_testing/TC_VALCC_4_3.py +++ b/src/python_testing/TC_VALCC_4_3.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_4.py b/src/python_testing/TC_VALCC_4_4.py index b85ff9a9f024e4..f6ad63d3682194 100644 --- a/src/python_testing/TC_VALCC_4_4.py +++ b/src/python_testing/TC_VALCC_4_4.py @@ -36,8 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, - utc_time_in_matter_epoch) +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_5.py b/src/python_testing/TC_VALCC_4_5.py index c6b7674c6c7f60..3b850c08043811 100644 --- a/src/python_testing/TC_VALCC_4_5.py +++ b/src/python_testing/TC_VALCC_4_5.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_WHM_1_2.py b/src/python_testing/TC_WHM_1_2.py index 2bbcdd5108b03f..9d7d9b28794a27 100644 --- a/src/python_testing/TC_WHM_1_2.py +++ b/src/python_testing/TC_WHM_1_2.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_WHM_2_1.py b/src/python_testing/TC_WHM_2_1.py index b9dcb0257d1b1a..6172ee013fdcba 100644 --- a/src/python_testing/TC_WHM_2_1.py +++ b/src/python_testing/TC_WHM_2_1.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_pics_checker.py b/src/python_testing/TC_pics_checker.py index 07e8613cc1cc4d..91e2102b5ec46d 100644 --- a/src/python_testing/TC_pics_checker.py +++ b/src/python_testing/TC_pics_checker.py @@ -17,13 +17,13 @@ import math import chip.clusters as Clusters -from chip.testing.basic_composition import BasicCompositionTests -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, FeaturePathLocation, - MatterBaseTest, ProblemLocation, TestStep, async_test_body, default_matter_test_main) -from chip.testing.pics import accepted_cmd_pics_str, attribute_pics_str, feature_pics_str, generated_cmd_pics_str -from chip.testing.spec_parsing import build_xml_clusters +from basic_composition_support import BasicCompositionTests +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, FeaturePathLocation, + MatterBaseTest, ProblemLocation, TestStep, async_test_body, default_matter_test_main) from mobly import asserts +from pics_support import accepted_cmd_pics_str, attribute_pics_str, feature_pics_str, generated_cmd_pics_str +from spec_parsing_support import build_xml_clusters class TC_PICS_Checker(MatterBaseTest, BasicCompositionTests): diff --git a/src/python_testing/TestBatchInvoke.py b/src/python_testing/TestBatchInvoke.py index 6465692c95fd63..a17f7b8be47013 100644 --- a/src/python_testing/TestBatchInvoke.py +++ b/src/python_testing/TestBatchInvoke.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts ''' Integration test of batch commands using UnitTesting Cluster diff --git a/src/python_testing/TestChoiceConformanceSupport.py b/src/python_testing/TestChoiceConformanceSupport.py index 77eca93761ab8f..8436bc8418a804 100644 --- a/src/python_testing/TestChoiceConformanceSupport.py +++ b/src/python_testing/TestChoiceConformanceSupport.py @@ -19,11 +19,11 @@ import xml.etree.ElementTree as ElementTree import jinja2 -from chip.testing.choice_conformance import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, - evaluate_feature_choice_conformance) -from chip.testing.matter_testing import MatterBaseTest, ProblemNotice, default_matter_test_main -from chip.testing.spec_parsing import XmlCluster, add_cluster_data_from_xml +from choice_conformance_support import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, + evaluate_feature_choice_conformance) +from matter_testing_support import MatterBaseTest, ProblemNotice, default_matter_test_main from mobly import asserts +from spec_parsing_support import XmlCluster, add_cluster_data_from_xml FEATURE_TEMPLATE = '''\ diff --git a/src/python_testing/TestCommissioningTimeSync.py b/src/python_testing/TestCommissioningTimeSync.py index d4033ea58ba8b6..dfd03d957d4f0b 100644 --- a/src/python_testing/TestCommissioningTimeSync.py +++ b/src/python_testing/TestCommissioningTimeSync.py @@ -20,7 +20,7 @@ from chip import ChipDeviceCtrl from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts # We don't have a good pipe between the c++ enums in CommissioningDelegate and python diff --git a/src/python_testing/TestConformanceSupport.py b/src/python_testing/TestConformanceSupport.py index ca41bf088e0fd2..3744b6fe5e70d5 100644 --- a/src/python_testing/TestConformanceSupport.py +++ b/src/python_testing/TestConformanceSupport.py @@ -18,11 +18,11 @@ import xml.etree.ElementTree as ElementTree from typing import Callable -from chip.testing.conformance import (Choice, Conformance, ConformanceDecision, ConformanceException, ConformanceParseParameters, - deprecated, disallowed, mandatory, optional, parse_basic_callable_from_xml, - parse_callable_from_xml, parse_device_type_callable_from_xml, provisional, zigbee) -from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main from chip.tlv import uint +from conformance_support import (Choice, Conformance, ConformanceDecision, ConformanceException, ConformanceParseParameters, + deprecated, disallowed, mandatory, optional, parse_basic_callable_from_xml, + parse_callable_from_xml, parse_device_type_callable_from_xml, provisional, zigbee) +from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestConformanceTest.py b/src/python_testing/TestConformanceTest.py index ddf3e421a7f75c..f0ff8032eab519 100644 --- a/src/python_testing/TestConformanceTest.py +++ b/src/python_testing/TestConformanceTest.py @@ -18,12 +18,12 @@ from typing import Any import chip.clusters as Clusters -from chip.testing.basic_composition import arls_populated -from chip.testing.conformance import ConformanceDecision -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main -from chip.testing.spec_parsing import build_xml_clusters, build_xml_device_types +from basic_composition_support import arls_populated +from conformance_support import ConformanceDecision +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts +from spec_parsing_support import build_xml_clusters, build_xml_device_types from TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TestGroupTableReports.py b/src/python_testing/TestGroupTableReports.py index 9d98a050c702f1..6e3980bcae429e 100644 --- a/src/python_testing/TestGroupTableReports.py +++ b/src/python_testing/TestGroupTableReports.py @@ -42,7 +42,7 @@ from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import SubscriptionTransaction, TypedAttributePath from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestIdChecks.py b/src/python_testing/TestIdChecks.py index eda01ef9556493..8969807d5819e3 100644 --- a/src/python_testing/TestIdChecks.py +++ b/src/python_testing/TestIdChecks.py @@ -15,10 +15,9 @@ # limitations under the License. # -from chip.testing.global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, - device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, - is_valid_device_type_id) -from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main +from global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, + device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, is_valid_device_type_id) +from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestMatterTestingSupport.py b/src/python_testing/TestMatterTestingSupport.py index 811349b3a96f6c..08c3e830d21271 100644 --- a/src/python_testing/TestMatterTestingSupport.py +++ b/src/python_testing/TestMatterTestingSupport.py @@ -22,15 +22,14 @@ import chip.clusters as Clusters from chip.clusters.Types import Nullable, NullValue -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, - get_wait_seconds_from_set_time, parse_matter_test_args, type_matches, - utc_time_in_matter_epoch) -from chip.testing.pics import parse_pics, parse_pics_xml -from chip.testing.taglist_and_topology_test import (TagProblem, create_device_type_list_for_root, create_device_type_lists, - find_tag_list_problems, find_tree_roots, flat_list_ok, get_all_children, - get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, + get_wait_seconds_from_set_time, parse_matter_test_args, type_matches, utc_time_in_matter_epoch) from mobly import asserts, signals +from pics_support import parse_pics, parse_pics_xml +from taglist_and_topology_test_support import (TagProblem, create_device_type_list_for_root, create_device_type_lists, + find_tag_list_problems, find_tree_roots, flat_list_ok, get_all_children, + get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) def get_raw_type_list(): diff --git a/src/python_testing/TestSpecParsingDeviceType.py b/src/python_testing/TestSpecParsingDeviceType.py index a9ee14f12b622f..7729ccee8af24d 100644 --- a/src/python_testing/TestSpecParsingDeviceType.py +++ b/src/python_testing/TestSpecParsingDeviceType.py @@ -18,12 +18,12 @@ import chip.clusters as Clusters from chip.clusters import Attribute -from chip.testing.conformance import conformance_allowed -from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main -from chip.testing.spec_parsing import build_xml_clusters, build_xml_device_types, parse_single_device_type from chip.tlv import uint +from conformance_support import conformance_allowed from jinja2 import Template +from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts +from spec_parsing_support import build_xml_clusters, build_xml_device_types, parse_single_device_type from TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TestSpecParsingSupport.py b/src/python_testing/TestSpecParsingSupport.py index b4c908c232fa94..4e0171b0779936 100644 --- a/src/python_testing/TestSpecParsingSupport.py +++ b/src/python_testing/TestSpecParsingSupport.py @@ -15,16 +15,17 @@ # limitations under the License. # +import os import xml.etree.ElementTree as ElementTree import chip.clusters as Clusters import jinja2 -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import MatterBaseTest, ProblemNotice, default_matter_test_main -from chip.testing.spec_parsing import (ClusterParser, DataModelLevel, PrebuiltDataModelDirectory, SpecParsingException, XmlCluster, - add_cluster_data_from_xml, build_xml_clusters, check_clusters_for_unknown_commands, - combine_derived_clusters_with_base, get_data_model_directory) +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import MatterBaseTest, ProblemNotice, default_matter_test_main from mobly import asserts +from spec_parsing_support import (ClusterParser, PrebuiltDataModelDirectory, SpecParsingException, XmlCluster, + add_cluster_data_from_xml, build_xml_clusters, check_clusters_for_unknown_commands, + combine_derived_clusters_with_base) # TODO: improve the test coverage here # https://github.com/project-chip/connectedhomeip/issues/30958 @@ -271,10 +272,10 @@ def test_build_xml_override(self): asserts.assert_equal(set(one_four_clusters.keys())-set(tot_xml_clusters.keys()), set(), "There are some 1.4 clusters that are not included in the TOT spec") - str_path = get_data_model_directory(PrebuiltDataModelDirectory.k1_4, DataModelLevel.kCluster) + str_path = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), + '..', '..', 'data_model', '1.4', 'clusters')) string_override_check, problems = build_xml_clusters(str_path) - - asserts.assert_count_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation") + asserts.assert_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation") with asserts.assert_raises(SpecParsingException): build_xml_clusters("baddir") diff --git a/src/python_testing/TestTimeSyncTrustedTimeSource.py b/src/python_testing/TestTimeSyncTrustedTimeSource.py index 50bca6f3da1f7f..2f4c9a1f55b8d1 100644 --- a/src/python_testing/TestTimeSyncTrustedTimeSource.py +++ b/src/python_testing/TestTimeSyncTrustedTimeSource.py @@ -18,7 +18,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # We don't have a good pipe between the c++ enums in CommissioningDelegate and python diff --git a/src/python_testing/TestUnitTestingErrorPath.py b/src/python_testing/TestUnitTestingErrorPath.py index 872f1fa9301866..70d7b966acda4e 100644 --- a/src/python_testing/TestUnitTestingErrorPath.py +++ b/src/python_testing/TestUnitTestingErrorPath.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts """ Integration test for error path returns via the UnitTesting cluster. diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/basic_composition.py b/src/python_testing/basic_composition_support.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/chip/testing/basic_composition.py rename to src/python_testing/basic_composition_support.py diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py b/src/python_testing/choice_conformance_support.py similarity index 93% rename from src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py rename to src/python_testing/choice_conformance_support.py index 7e7775d555261d..58d37bf10180b0 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py +++ b/src/python_testing/choice_conformance_support.py @@ -1,8 +1,8 @@ -from chip.testing.conformance import Choice, ConformanceDecisionWithChoice -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import AttributePathLocation, ProblemNotice, ProblemSeverity -from chip.testing.spec_parsing import XmlCluster from chip.tlv import uint +from conformance_support import Choice, ConformanceDecisionWithChoice +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import AttributePathLocation, ProblemNotice, ProblemSeverity +from spec_parsing_support import XmlCluster class ChoiceConformanceProblemNotice(ProblemNotice): diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/conformance.py b/src/python_testing/conformance_support.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/chip/testing/conformance.py rename to src/python_testing/conformance_support.py diff --git a/src/python_testing/drlk_2_x_common.py b/src/python_testing/drlk_2_x_common.py index cdd13822929cff..92c0ab23ceb620 100644 --- a/src/python_testing/drlk_2_x_common.py +++ b/src/python_testing/drlk_2_x_common.py @@ -23,7 +23,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import type_matches +from matter_testing_support import type_matches from mobly import asserts diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index 34a391873b3101..4e678211c5ddce 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -53,7 +53,7 @@ def main(search_directory, env_file): # Define the base command to run tests base_command = os.path.join(chip_root, "scripts/tests/run_python_test.py") - # Define the test python script files and patterns to exclude + # Define the files and patterns to exclude excluded_patterns = { "MinimalRepresentation.py", # Code/Test not being used or not shared code for any other tests "TC_CNET_4_4.py", # It has no CI execution block, is not executed in CI @@ -84,6 +84,14 @@ def main(search_directory, env_file): "hello_test.py", # Is a template for tests "test_plan_support.py", # Shared code for TC_*, not a standalone test "test_plan_table_generator.py", # Code/Test not being used or not shared code for any other tests + "basic_composition_support.py", # Test support/shared code script, not a standalone test + "choice_conformance_support.py", # Test support/shared code script, not a standalone test + "conformance_support.py", # Test support/shared code script, not a standalone test + "global_attribute_ids.py", # Test support/shared code script, not a standalone test + "matter_testing_support.py", # Test support/shared code script, not a standalone test + "pics_support.py", # Test support/shared code script, not a standalone test + "spec_parsing_support.py", # Test support/shared code script, not a standalone test + "taglist_and_topology_test_support.py" # Test support/shared code script, not a standalone test } # Get all .py files in the directory diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py b/src/python_testing/global_attribute_ids.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py rename to src/python_testing/global_attribute_ids.py diff --git a/src/python_testing/hello_external_runner.py b/src/python_testing/hello_external_runner.py index 64af55ce0710e1..5f00eeb287a543 100755 --- a/src/python_testing/hello_external_runner.py +++ b/src/python_testing/hello_external_runner.py @@ -23,8 +23,8 @@ from multiprocessing import Process from multiprocessing.managers import BaseManager -from chip.testing.matter_testing import MatterTestConfig, get_test_info, run_tests from hello_test import HelloTest +from matter_testing_support import MatterTestConfig, get_test_info, run_tests try: from matter_yamltests.hooks import TestRunnerHooks diff --git a/src/python_testing/hello_test.py b/src/python_testing/hello_test.py index 2d910b1e52b364..0793ee3b10387d 100644 --- a/src/python_testing/hello_test.py +++ b/src/python_testing/hello_test.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/matter_testing_infrastructure/BUILD.gn b/src/python_testing/matter_testing_infrastructure/BUILD.gn index 19c7aee68defd9..41bbcef22b8c2e 100644 --- a/src/python_testing/matter_testing_infrastructure/BUILD.gn +++ b/src/python_testing/matter_testing_infrastructure/BUILD.gn @@ -18,6 +18,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("$dir_pw_build/python.gni") +# Python package for CHIP testing support. pw_python_package("chip-testing") { setup = [ "setup.py", @@ -30,15 +31,7 @@ pw_python_package("chip-testing") { sources = [ "chip/testing/__init__.py", "chip/testing/apps.py", - "chip/testing/basic_composition.py", - "chip/testing/choice_conformance.py", - "chip/testing/conformance.py", - "chip/testing/global_attribute_ids.py", - "chip/testing/matter_testing.py", "chip/testing/metadata.py", - "chip/testing/pics.py", - "chip/testing/spec_parsing.py", - "chip/testing/taglist_and_topology_test.py", "chip/testing/tasks.py", ] diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py index 3b21a1c050ae0d..af56efc3d58ff5 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py @@ -16,7 +16,7 @@ import signal import tempfile -from chip.testing.tasks import Subprocess +from .tasks import Subprocess class AppServerSubprocess(Subprocess): diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py b/src/python_testing/matter_testing_support.py similarity index 99% rename from src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py rename to src/python_testing/matter_testing_support.py index 2d23a9f84b0192..2e153a37dec551 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py +++ b/src/python_testing/matter_testing_support.py @@ -65,12 +65,12 @@ from chip.interaction_model import InteractionModelError, Status from chip.setup_payload import SetupPayload from chip.storage import PersistentStorage -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.pics import read_pics_from_file from chip.tracing import TracingContext +from global_attribute_ids import GlobalAttributeIds from mobly import asserts, base_test, signals, utils from mobly.config_parser import ENV_MOBLY_LOGPATH, TestRunConfig from mobly.test_runner import TestRunner +from pics_support import read_pics_from_file try: from matter_yamltests.hooks import TestRunnerHooks @@ -2278,7 +2278,7 @@ def default_matter_test_main(): In this case, only one test class in a test script is allowed. To make your test script executable, add the following to your file: .. code-block:: python - from chip.testing.matter_testing.py import default_matter_test_main + from matter_testing_support.py import default_matter_test_main ... if __name__ == '__main__': default_matter_test_main.main() diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/pics.py b/src/python_testing/pics_support.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/chip/testing/pics.py rename to src/python_testing/pics_support.py diff --git a/src/python_testing/post_certification_tests/production_device_checks.py b/src/python_testing/post_certification_tests/production_device_checks.py index b8e567f76a4504..e4262a09e70ab8 100644 --- a/src/python_testing/post_certification_tests/production_device_checks.py +++ b/src/python_testing/post_certification_tests/production_device_checks.py @@ -59,15 +59,15 @@ os.path.join(os.path.dirname(__file__), '..', '..', '..')) try: - from chip.testing.basic_composition import BasicCompositionTests - from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - run_tests_no_exit) + from basic_composition_support import BasicCompositionTests + from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + run_tests_no_exit) except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from chip.testing.basic_composition import BasicCompositionTests - from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - run_tests_no_exit) + from basic_composition_support import BasicCompositionTests + from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + run_tests_no_exit) try: import fetch_paa_certs_from_dcl diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py b/src/python_testing/spec_parsing_support.py similarity index 95% rename from src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py rename to src/python_testing/spec_parsing_support.py index 97a13606eabc45..75ffea120ff126 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py +++ b/src/python_testing/spec_parsing_support.py @@ -26,14 +26,14 @@ from typing import Callable, Optional import chip.clusters as Clusters -import chip.testing.conformance as conformance_support -from chip.testing.conformance import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException, - ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation, - parse_callable_from_xml, parse_device_type_callable_from_xml) -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, - EventPathLocation, FeaturePathLocation, ProblemNotice, ProblemSeverity) +import conformance_support from chip.tlv import uint +from conformance_support import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException, + ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation, + parse_callable_from_xml, parse_device_type_callable_from_xml) +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, + EventPathLocation, FeaturePathLocation, ProblemNotice, ProblemSeverity) _PRIVILEGE_STR = { None: "N/A", @@ -518,36 +518,19 @@ class DataModelLevel(str, Enum): kDeviceType = 'device_types' -def _get_data_model_root() -> str: - """Attempts to find ${CHIP_ROOT}/data_model or equivalent.""" - - # Since this class is generally in a module, we have to rely on being bootstrapped or - # we use CWD if we cannot - choices = [os.getcwd()] - - if 'PW_PROJECT_ROOT' in os.environ: - choices.insert(0, os.environ['PW_PROJECT_ROOT']) - - for c in choices: - data_model_path = os.path.join(c, 'data_model') - if os.path.exists(os.path.join(data_model_path, 'master', 'scraper_version')): - return data_model_path - raise FileNotFoundError('Cannot find a CHIP_ROOT/data_model path. Tried %r as prefixes.' % choices) - - -def get_data_model_directory(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str], data_model_level: DataModelLevel) -> str: +def _get_data_model_directory(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str], data_model_level: DataModelLevel) -> str: if data_model_directory == PrebuiltDataModelDirectory.k1_3: - return os.path.join(_get_data_model_root(), '1.3', data_model_level) + return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.3', data_model_level) elif data_model_directory == PrebuiltDataModelDirectory.k1_4: - return os.path.join(_get_data_model_root(), '1.4', data_model_level) + return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.4', data_model_level) elif data_model_directory == PrebuiltDataModelDirectory.kMaster: - return os.path.join(_get_data_model_root(), 'master', data_model_level) + return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', 'master', data_model_level) else: return data_model_directory def build_xml_clusters(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.k1_4) -> tuple[dict[uint, XmlCluster], list[ProblemNotice]]: - dir = get_data_model_directory(data_model_directory, DataModelLevel.kCluster) + dir = _get_data_model_directory(data_model_directory, DataModelLevel.kCluster) clusters: dict[int, XmlCluster] = {} pure_base_clusters: dict[str, XmlCluster] = {} @@ -794,7 +777,7 @@ def parse_single_device_type(root: ElementTree.Element) -> tuple[list[ProblemNot def build_xml_device_types(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.k1_4) -> tuple[dict[int, XmlDeviceType], list[ProblemNotice]]: - dir = get_data_model_directory(data_model_directory, DataModelLevel.kDeviceType) + dir = _get_data_model_directory(data_model_directory, DataModelLevel.kDeviceType) device_types: dict[int, XmlDeviceType] = {} problems = [] for xml in glob.glob(f"{dir}/*.xml"): diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py b/src/python_testing/taglist_and_topology_test_support.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py rename to src/python_testing/taglist_and_topology_test_support.py diff --git a/src/python_testing/test_plan_table_generator.py b/src/python_testing/test_plan_table_generator.py index b38f6f94df6c1d..c972116f343dde 100755 --- a/src/python_testing/test_plan_table_generator.py +++ b/src/python_testing/test_plan_table_generator.py @@ -22,7 +22,7 @@ from pathlib import Path import click -from chip.testing.matter_testing import MatterTestConfig, generate_mobly_test_config +from matter_testing_support import MatterTestConfig, generate_mobly_test_config def indent_multiline(multiline: str, num_spaces: int) -> str: diff --git a/src/python_testing/test_testing/MockTestRunner.py b/src/python_testing/test_testing/MockTestRunner.py index 6c9bc1c0884d41..2d0afb8a5c2e67 100644 --- a/src/python_testing/test_testing/MockTestRunner.py +++ b/src/python_testing/test_testing/MockTestRunner.py @@ -22,7 +22,13 @@ from unittest.mock import MagicMock from chip.clusters import Attribute -from chip.testing.matter_testing import MatterStackState, MatterTestConfig, run_tests_no_exit + +try: + from matter_testing_support import MatterStackState, MatterTestConfig, run_tests_no_exit +except ImportError: + sys.path.append(os.path.abspath( + os.path.join(os.path.dirname(__file__), '..'))) + from matter_testing_support import MatterStackState, MatterTestConfig, run_tests_no_exit class AsyncMock(MagicMock): @@ -50,15 +56,7 @@ def __init__(self, filename: str, classname: str, test: str, endpoint: int = Non def set_test(self, filename: str, classname: str, test: str): self.test = test self.config.tests = [self.test] - - module_name = Path(os.path.basename(filename)).stem - - try: - module = importlib.import_module(module_name) - except ModuleNotFoundError: - sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - module = importlib.import_module(module_name) - + module = importlib.import_module(Path(os.path.basename(filename)).stem) self.test_class = getattr(module, classname) def set_test_config(self, test_config: MatterTestConfig = MatterTestConfig()): diff --git a/src/python_testing/test_testing/TestDecorators.py b/src/python_testing/test_testing/TestDecorators.py index ce32518b71c7c3..82b49eddd86953 100644 --- a/src/python_testing/test_testing/TestDecorators.py +++ b/src/python_testing/test_testing/TestDecorators.py @@ -25,13 +25,23 @@ # # You will get step_* calls as appropriate in between the test_start and test_stop calls if the test is not skipped. +import os import sys -from typing import Optional import chip.clusters as Clusters from chip.clusters import Attribute -from chip.testing.matter_testing import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, has_cluster, has_feature, - run_if_endpoint_matches, run_on_singleton_matching_endpoint, should_run_test_on_endpoint) + +try: + from matter_testing_support import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, has_cluster, has_feature, + run_if_endpoint_matches, run_on_singleton_matching_endpoint, should_run_test_on_endpoint) +except ImportError: + sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + from matter_testing_support import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, + has_cluster, has_feature, run_if_endpoint_matches, run_on_singleton_matching_endpoint, + should_run_test_on_endpoint) + +from typing import Optional + from mobly import asserts from MockTestRunner import MockTestRunner diff --git a/src/python_testing/test_testing/test_IDM_10_4.py b/src/python_testing/test_testing/test_IDM_10_4.py index 8a30609e94e2cf..8634e94129b86a 100644 --- a/src/python_testing/test_testing/test_IDM_10_4.py +++ b/src/python_testing/test_testing/test_IDM_10_4.py @@ -21,7 +21,13 @@ import chip.clusters as Clusters from chip.clusters import Attribute -from chip.testing.pics import parse_pics_xml + +try: + from pics_support import parse_pics_xml +except ImportError: + sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + from pics_support import parse_pics_xml + from MockTestRunner import MockTestRunner # Reachable attribute is off in the pics file diff --git a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py index 6a2dc48ba4ebd9..bd28023b8e32e8 100644 --- a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py +++ b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py @@ -30,11 +30,11 @@ from MockTestRunner import AsyncMock, MockTestRunner try: - from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit invoke_call_count = 0 event_call_count = 0 diff --git a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py index ed9f1b353149c6..d79b4125309e11 100644 --- a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py +++ b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py @@ -30,11 +30,11 @@ from MockTestRunner import AsyncMock, MockTestRunner try: - from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit invoke_call_count = 0 event_call_count = 0 diff --git a/src/python_testing/test_testing/test_TC_SC_7_1.py b/src/python_testing/test_testing/test_TC_SC_7_1.py index 96dced72f952af..3b1b6a5b1cd269 100644 --- a/src/python_testing/test_testing/test_TC_SC_7_1.py +++ b/src/python_testing/test_testing/test_TC_SC_7_1.py @@ -16,14 +16,21 @@ # limitations under the License. # +import os import sys from random import randbytes import chip.clusters as Clusters from chip.clusters import Attribute -from chip.testing.matter_testing import MatterTestConfig from MockTestRunner import MockTestRunner +try: + from matter_testing_support import MatterTestConfig +except ImportError: + sys.path.append(os.path.abspath( + os.path.join(os.path.dirname(__file__), '..'))) + from matter_testing_support import MatterTestConfig + def read_trusted_root(filled: bool) -> Attribute.AsyncReadTransaction.ReadResponse: opcreds = Clusters.OperationalCredentials diff --git a/src/tools/PICS-generator/PICSGenerator.py b/src/tools/PICS-generator/PICSGenerator.py index 6cfb95803af52b..acdeb676ed8aa5 100644 --- a/src/tools/PICS-generator/PICSGenerator.py +++ b/src/tools/PICS-generator/PICSGenerator.py @@ -25,10 +25,10 @@ from pics_generator_support import map_cluster_name_to_pics_xml, pics_xml_file_list_loader from rich.console import Console -# Add the path to python_testing folder, in order to be able to import from chip.testing.matter_testing +# Add the path to python_testing folder, in order to be able to import from matter_testing_support sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 -from chip.testing.spec_parsing import build_xml_clusters # noqa: E402 +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 +from spec_parsing_support import build_xml_clusters # noqa: E402 console = None xml_clusters = None diff --git a/src/tools/PICS-generator/XMLPICSValidator.py b/src/tools/PICS-generator/XMLPICSValidator.py index 5fd170463d3e7a..d728a61991edf0 100644 --- a/src/tools/PICS-generator/XMLPICSValidator.py +++ b/src/tools/PICS-generator/XMLPICSValidator.py @@ -23,7 +23,7 @@ # Add the path to python_testing folder, in order to be able to import from matter_testing_support sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from chip.testing.spec_parsing import build_xml_clusters # noqa: E402 +from spec_parsing_support import build_xml_clusters # noqa: E402 parser = argparse.ArgumentParser() parser.add_argument('--pics-template', required=True) diff --git a/src/tools/device-graph/matter-device-graph.py b/src/tools/device-graph/matter-device-graph.py index 597468624d0ea1..16a2e6dbb0cd5b 100644 --- a/src/tools/device-graph/matter-device-graph.py +++ b/src/tools/device-graph/matter-device-graph.py @@ -23,9 +23,9 @@ import graphviz from rich.console import Console -# Add the path to python_testing folder, in order to be able to import from chip.testing.matter_testing +# Add the path to python_testing folder, in order to be able to import from matter_testing_support sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 console = None maxClusterNameLength = 30