Skip to content

Commit 644ecdd

Browse files
restyled-commitsandy31415
authored andcommitted
Restyled by isort
1 parent 9231121 commit 644ecdd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+91
-116
lines changed

scripts/tests/run_python_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
import click
3030
import coloredlogs
31-
from colorama import Fore, Style
3231
from chip.testing.metadata import Metadata, MetadataReader
3332
from chip.testing.tasks import Subprocess
33+
from colorama import Fore, Style
3434

3535
DEFAULT_CHIP_ROOT = os.path.abspath(
3636
os.path.join(os.path.dirname(__file__), '..', '..'))

src/python_testing/MinimalRepresentation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
from dataclasses import dataclass, field
1919

20-
from chip.tlv import uint
2120
from chip.testing.conformance import ConformanceDecision
2221
from chip.testing.global_attribute_ids import GlobalAttributeIds
2322
from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main
23+
from chip.tlv import uint
2424
from TC_DeviceConformance import DeviceConformanceTests
2525

2626

src/python_testing/TC_AccessChecker.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424

2525
import chip.clusters as Clusters
2626
from chip.interaction_model import Status
27-
from chip.tlv import uint
2827
from chip.testing.basic_composition import BasicCompositionTests
2928
from chip.testing.global_attribute_ids import GlobalAttributeIds
30-
from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep,
31-
async_test_body, default_matter_test_main)
29+
from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep, async_test_body,
30+
default_matter_test_main)
3231
from chip.testing.spec_parsing import XmlCluster, build_xml_clusters
32+
from chip.tlv import uint
3333

3434

3535
class AccessTestType(Enum):

src/python_testing/TC_BRBINFO_4_1.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@
5353
from chip import ChipDeviceCtrl
5454
from chip.interaction_model import InteractionModelError, Status
5555
from chip.testing.apps import IcdAppServerSubprocess
56-
from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, TestStep, async_test_body,
57-
default_matter_test_main)
56+
from chip.testing.matter_testing import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main
5857
from mobly import asserts
5958

6059
logger = logging.getLogger(__name__)

src/python_testing/TC_CCTRL_2_1.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
# === END CI TEST ARGUMENTS ===
3939

4040
import chip.clusters as Clusters
41-
from chip.testing.matter_testing import (MatterBaseTest, TestStep, default_matter_test_main, has_cluster,
42-
run_if_endpoint_matches)
41+
from chip.testing.matter_testing import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches
4342
from mobly import asserts
4443

4544

src/python_testing/TC_CC_2_2.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141

4242
import chip.clusters as Clusters
4343
from chip.clusters import ClusterObjects as ClusterObjects
44-
from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep,
45-
default_matter_test_main, has_cluster, run_if_endpoint_matches)
44+
from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main,
45+
has_cluster, run_if_endpoint_matches)
4646
from mobly import asserts
4747
from test_plan_support import commission_if_required, read_attribute, verify_success
4848

src/python_testing/TC_DA_1_2.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@
4141

4242
import chip.clusters as Clusters
4343
from chip.interaction_model import InteractionModelError, Status
44+
from chip.testing.basic_composition import BasicCompositionTests
45+
from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, hex_from_bytes,
46+
type_matches)
4447
from chip.tlv import TLVReader
4548
from cryptography import x509
4649
from cryptography.exceptions import InvalidSignature
4750
from cryptography.hazmat._oid import ExtensionOID
4851
from cryptography.hazmat.primitives import hashes
4952
from cryptography.hazmat.primitives.asymmetric import ec, utils
5053
from ecdsa.curves import curve_by_name
51-
from chip.testing.basic_composition import BasicCompositionTests
52-
from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main,
53-
hex_from_bytes, type_matches)
5454
from mobly import asserts
5555
from pyasn1.codec.der.decoder import decode as der_decoder
5656
from pyasn1.error import PyAsn1Error

src/python_testing/TC_DA_1_5.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@
4040
import chip.clusters as Clusters
4141
from chip import ChipDeviceCtrl
4242
from chip.interaction_model import InteractionModelError, Status
43+
from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes, type_matches
4344
from chip.tlv import TLVReader
4445
from cryptography import x509
4546
from cryptography.hazmat.primitives import hashes
4647
from cryptography.hazmat.primitives.asymmetric import ec, utils
4748
from ecdsa.curves import curve_by_name
48-
from chip.testing.matter_testing import (MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes,
49-
type_matches)
5049
from mobly import asserts
5150
from pyasn1.codec.der.decoder import decode as der_decoder
5251
from pyasn1.error import PyAsn1Error

src/python_testing/TC_DA_1_7.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
from typing import List, Optional
4242

4343
import chip.clusters as Clusters
44+
from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex, default_matter_test_main,
45+
hex_from_bytes)
4446
from cryptography.exceptions import InvalidSignature
4547
from cryptography.hazmat.primitives import hashes
4648
from cryptography.hazmat.primitives.asymmetric import ec
4749
from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat
4850
from cryptography.x509 import AuthorityKeyIdentifier, Certificate, SubjectKeyIdentifier, load_der_x509_certificate
49-
from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex,
50-
default_matter_test_main, hex_from_bytes)
5151
from mobly import asserts
5252

5353
# Those are SDK samples that are known to be non-production.

src/python_testing/TC_DEM_2_2.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@
5252

5353
import chip.clusters as Clusters
5454
from chip.interaction_model import Status
55-
from chip.testing.matter_testing import (EventChangeCallback, MatterBaseTest, TestStep, async_test_body,
56-
default_matter_test_main)
55+
from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main
5756
from mobly import asserts
5857
from TC_DEMTestBase import DEMTestBase
5958

src/python_testing/TC_DEM_2_4.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
import chip.clusters as Clusters
4848
from chip.clusters.Types import NullValue
4949
from chip.interaction_model import Status
50-
from chip.testing.matter_testing import (EventChangeCallback, MatterBaseTest, TestStep, async_test_body,
51-
default_matter_test_main)
50+
from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main
5251
from mobly import asserts
5352
from TC_DEMTestBase import DEMTestBase
5453

src/python_testing/TC_DRLK_2_12.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
# quiet: true
3636
# === END CI TEST ARGUMENTS ===
3737

38-
from drlk_2_x_common import DRLK_COMMON
3938
from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main
39+
from drlk_2_x_common import DRLK_COMMON
4040

4141
# Configurable parameters:
4242
# - userIndex: userIndex to use when creating a user on the DUT for testing purposes

src/python_testing/TC_DRLK_2_2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
# quiet: true
3636
# === END CI TEST ARGUMENTS ===
3737

38-
from drlk_2_x_common import DRLK_COMMON
3938
from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main
39+
from drlk_2_x_common import DRLK_COMMON
4040

4141
# Configurable parameters:
4242
# - userIndex: userIndex to use when creating a user on the DUT for testing purposes

src/python_testing/TC_DRLK_2_3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
# quiet: true
3636
# === END CI TEST ARGUMENTS ===
3737

38-
from drlk_2_x_common import DRLK_COMMON
3938
from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main
39+
from drlk_2_x_common import DRLK_COMMON
4040

4141
# Configurable parameters:
4242
# - userIndex: userIndex to use when creating a user on the DUT for testing purposes

src/python_testing/TC_DRLK_2_9.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
import chip.clusters as Clusters
4242
from chip.clusters.Types import NullValue
4343
from chip.interaction_model import InteractionModelError, Status
44-
from drlk_2_x_common import DRLK_COMMON
4544
from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches
45+
from drlk_2_x_common import DRLK_COMMON
4646
from mobly import asserts
4747

4848
logger = logging.getLogger(__name__)

src/python_testing/TC_DeviceBasicComposition.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,14 @@
107107
from chip.clusters.Attribute import ValueDecodeFailure
108108
from chip.clusters.ClusterObjects import ClusterAttributeDescriptor, ClusterObjectFieldDescriptor
109109
from chip.interaction_model import InteractionModelError, Status
110-
from chip.tlv import uint
111110
from chip.testing.basic_composition import BasicCompositionTests
112111
from chip.testing.global_attribute_ids import GlobalAttributeIds
113-
from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest,
114-
TestStep, async_test_body, default_matter_test_main)
112+
from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep,
113+
async_test_body, default_matter_test_main)
115114
from chip.testing.taglist_and_topology_test import (create_device_type_list_for_root, create_device_type_lists,
116115
find_tag_list_problems, find_tree_roots, flat_list_ok,
117-
get_direct_children_of_root, parts_list_cycles,
118-
separate_endpoint_types)
116+
get_direct_children_of_root, parts_list_cycles, separate_endpoint_types)
117+
from chip.tlv import uint
119118
from mobly import asserts
120119

121120

src/python_testing/TC_DeviceConformance.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,16 @@
3939
from typing import Callable
4040

4141
import chip.clusters as Clusters
42-
from chip.tlv import uint
4342
from chip.testing.basic_composition import BasicCompositionTests
4443
from chip.testing.choice_conformance import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance,
4544
evaluate_feature_choice_conformance)
4645
from chip.testing.conformance import ConformanceDecision, conformance_allowed
4746
from chip.testing.global_attribute_ids import (ClusterIdType, DeviceTypeIdType, GlobalAttributeIds, cluster_id_type,
4847
device_type_id_type, is_valid_device_type_id)
49-
from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation,
50-
DeviceTypePathLocation, MatterBaseTest, ProblemNotice, ProblemSeverity,
51-
async_test_body, default_matter_test_main)
48+
from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation,
49+
MatterBaseTest, ProblemNotice, ProblemSeverity, async_test_body, default_matter_test_main)
5250
from chip.testing.spec_parsing import CommandType, build_xml_clusters, build_xml_device_types
51+
from chip.tlv import uint
5352

5453

5554
class DeviceConformanceTests(BasicCompositionTests):

src/python_testing/TC_ECOINFO_2_1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
import chip.clusters as Clusters
4747
from chip.clusters.Types import NullValue
4848
from chip.interaction_model import Status
49-
from chip.tlv import uint
5049
from chip.testing.apps import AppServerSubprocess
5150
from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches
51+
from chip.tlv import uint
5252
from mobly import asserts
5353

5454

src/python_testing/TC_EEVSE_2_2.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646

4747
import chip.clusters as Clusters
4848
from chip.clusters.Types import NullValue
49-
from chip.testing.matter_testing import (EventChangeCallback, MatterBaseTest, TestStep, async_test_body,
50-
default_matter_test_main)
49+
from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main
5150
from mobly import asserts
5251
from TC_EEVSE_Utils import EEVSEBaseTestHelper
5352

src/python_testing/TC_EEVSE_2_3.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
import chip.clusters as Clusters
4747
from chip.clusters.Types import NullValue
4848
from chip.interaction_model import Status
49-
from chip.testing.matter_testing import (EventChangeCallback, MatterBaseTest, TestStep, async_test_body,
50-
default_matter_test_main)
49+
from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main
5150
from mobly import asserts
5251
from TC_EEVSE_Utils import EEVSEBaseTestHelper
5352

src/python_testing/TC_EEVSE_2_4.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545

4646
import chip.clusters as Clusters
4747
from chip.clusters.Types import NullValue
48-
from chip.testing.matter_testing import (EventChangeCallback, MatterBaseTest, TestStep, async_test_body,
49-
default_matter_test_main)
48+
from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main
5049
from TC_EEVSE_Utils import EEVSEBaseTestHelper
5150

5251
logger = logging.getLogger(__name__)

src/python_testing/TC_EEVSE_2_5.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
import chip.clusters as Clusters
4646
from chip.clusters.Types import NullValue
4747
from chip.interaction_model import Status
48-
from chip.testing.matter_testing import (EventChangeCallback, MatterBaseTest, TestStep, async_test_body,
49-
default_matter_test_main)
48+
from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main
5049
from TC_EEVSE_Utils import EEVSEBaseTestHelper
5150

5251
logger = logging.getLogger(__name__)

src/python_testing/TC_EWATERHTR_2_2.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
import time
4848

4949
import chip.clusters as Clusters
50-
from chip.testing.matter_testing import (EventChangeCallback, MatterBaseTest, TestStep, async_test_body,
51-
default_matter_test_main)
50+
from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main
5251
from mobly import asserts
5352
from TC_EWATERHTRBase import EWATERHTRBase
5453

src/python_testing/TC_EWATERHTR_2_3.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
import logging
4646

4747
import chip.clusters as Clusters
48-
from chip.testing.matter_testing import (EventChangeCallback, MatterBaseTest, TestStep, async_test_body,
49-
default_matter_test_main)
48+
from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main
5049
from mobly import asserts
5150
from TC_EWATERHTRBase import EWATERHTRBase
5251

src/python_testing/TC_IDM_4_2.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
from chip.clusters.Attribute import AttributePath, TypedAttributePath
4545
from chip.exceptions import ChipStackError
4646
from chip.interaction_model import Status
47-
from chip.testing.matter_testing import (AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body,
48-
default_matter_test_main)
47+
from chip.testing.matter_testing import AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main
4948
from mobly import asserts
5049

5150
'''

src/python_testing/TC_LVL_2_3.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141

4242
import chip.clusters as Clusters
4343
import test_plan_support
44-
from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep,
45-
default_matter_test_main, has_cluster, run_if_endpoint_matches)
44+
from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main,
45+
has_cluster, run_if_endpoint_matches)
4646
from mobly import asserts
4747

4848

src/python_testing/TC_MCORE_FS_1_2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050

5151
import chip.clusters as Clusters
5252
from chip import ChipDeviceCtrl
53-
from ecdsa.curves import NIST256p
5453
from chip.testing.apps import AppServerSubprocess
5554
from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches
55+
from ecdsa.curves import NIST256p
5656
from mobly import asserts
5757
from TC_SC_3_6 import AttributeChangeAccumulator
5858

src/python_testing/TC_MCORE_FS_1_5.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050

5151
import chip.clusters as Clusters
5252
from chip import ChipDeviceCtrl
53-
from ecdsa.curves import NIST256p
5453
from chip.testing.apps import AppServerSubprocess
5554
from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches
55+
from ecdsa.curves import NIST256p
5656
from mobly import asserts
5757
from TC_SC_3_6 import AttributeChangeAccumulator
5858

src/python_testing/TC_OPCREDS_3_1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
from chip import ChipDeviceCtrl
4343
from chip.exceptions import ChipStackError
4444
from chip.interaction_model import InteractionModelError, Status
45-
from chip.tlv import TLVReader, TLVWriter
4645
from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main
46+
from chip.tlv import TLVReader, TLVWriter
4747
from mobly import asserts
4848

4949

src/python_testing/TC_OPCREDS_3_2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
# === END CI TEST ARGUMENTS ===
3737

3838
import chip.clusters as Clusters
39+
from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main
3940
from chip.tlv import TLVReader
4041
from chip.utils import CommissioningBuildingBlocks
41-
from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main
4242
from mobly import asserts
4343
from test_plan_support import (commission_from_existing, commission_if_required, read_attribute, remove_fabric,
4444
verify_commissioning_successful, verify_success)

src/python_testing/TC_RR_1_1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545

4646
import chip.clusters as Clusters
4747
from chip.interaction_model import Status as StatusEnum
48-
from chip.utils import CommissioningBuildingBlocks
4948
from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main
49+
from chip.utils import CommissioningBuildingBlocks
5050
from mobly import asserts
5151
from TC_SC_3_6 import AttributeChangeAccumulator, ResubscriptionCatcher
5252

src/python_testing/TC_SC_3_6.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
import chip.clusters as Clusters
4646
from chip.clusters import ClusterObjects as ClustersObjects
4747
from chip.clusters.Attribute import SubscriptionTransaction, TypedAttributePath
48-
from chip.utils import CommissioningBuildingBlocks
4948
from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main
49+
from chip.utils import CommissioningBuildingBlocks
5050
from mobly import asserts
5151

5252
# TODO: Overall, we need to add validation that session IDs have not changed throughout to be agnostic

src/python_testing/TC_SWTCH.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@
9090
import test_plan_support
9191
from chip.clusters import ClusterObjects as ClusterObjects
9292
from chip.clusters.Attribute import EventReadResult
93+
from chip.testingsting import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep,
94+
await_sequence_of_reports, default_matter_test_main, has_feature, run_if_endpoint_matches)
9395
from chip.tlv import uint
94-
from chip.testingsting import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback,
95-
MatterBaseTest, TestStep, await_sequence_of_reports, default_matter_test_main,
96-
has_feature, run_if_endpoint_matches)
9796
from mobly import asserts
9897

9998
logger = logging.getLogger(__name__)

0 commit comments

Comments
 (0)