Skip to content

Commit 679c188

Browse files
committed
Rename the python file to TC_EEVSEM_1_2
1 parent d256d93 commit 679c188

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed

src/python_testing/TC_EEVSEM_1_2.py

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#
2+
# Copyright (c) 2025 Project CHIP Authors
3+
# All rights reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments
19+
# for details about the block below.
20+
#
21+
# FIXME: https://github.com/project-chip/connectedhomeip/issues/36885
22+
# === BEGIN CI TEST ARGUMENTS ===
23+
# test-runner-runs:
24+
# run1:
25+
# app: ${CHIP_MICROWAVE_OVEN_APP}
26+
# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json
27+
# script-args: >
28+
# --storage-path admin_storage.json
29+
# --commissioning-method on-network
30+
# --discriminator 1234
31+
# --passcode 20202021
32+
# --PICS src/app/tests/suites/certification/ci-pics-values
33+
# --endpoint 1
34+
# --trace-to json:${TRACE_TEST_JSON}.json
35+
# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
36+
# factory-reset: true
37+
# quiet: true
38+
# === END CI TEST ARGUMENTS ===
39+
40+
import logging
41+
42+
import chip.clusters as Clusters
43+
from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main
44+
from modebase_cluster_check import ModeBaseClusterChecks
45+
46+
logger = logging.getLogger(__name__)
47+
48+
CLUSTER = Clusters.EnergyEvseMode
49+
50+
51+
class TC_EEVSEM_1_2(MatterBaseTest, ModeBaseClusterChecks):
52+
53+
def __init__(self, *args):
54+
MatterBaseTest.__init__(self, *args)
55+
ModeBaseClusterChecks.__init__(self,
56+
modebase_derived_cluster=CLUSTER)
57+
58+
def desc_TC_EEVSEM_1_2(self) -> str:
59+
return "[TC-EEVSEM-1.2] Cluster attributes with DUT as Server"
60+
61+
def steps_TC_EEVSEM_1_2(self) -> list[TestStep]:
62+
steps = [
63+
TestStep(1, "Commissioning, already done", is_commissioning=True),
64+
TestStep(2, "TH reads from the DUT the SupportedModes attribute."),
65+
TestStep(3, "TH reads from the DUT the CurrentMode attribute."),
66+
# TestStep(4, "TH reads from the DUT the OnMode attribute."),
67+
# TestStep(5, "TH reads from the DUT the StartUpMode attribute.")
68+
]
69+
return steps
70+
71+
def pics_TC_EEVSEM_1_2(self) -> list[str]:
72+
pics = [
73+
"EEVSEM.S"
74+
]
75+
return pics
76+
77+
@async_test_body
78+
async def test_TC_EEVSEM_1_2(self):
79+
80+
# Setup common mode check
81+
endpoint = self.get_endpoint(default=1)
82+
83+
self.step(1)
84+
85+
self.step(2)
86+
# Verify common checks for Mode Base as described in the TC-EEVSEM-1.2
87+
supported_modes = await self.check_supported_modes_and_labels(endpoint=endpoint)
88+
logger.info(f'Step #2: supported_modes({supported_modes})')
89+
90+
# According to the spec, there should be at least one Manual or Time of Use tag in
91+
# the ones supported.
92+
additional_tags = [CLUSTER.Enums.ModeTag.kManual,
93+
CLUSTER.Enums.ModeTag.kTimeOfUse]
94+
self.check_tags_in_lists(supported_modes=supported_modes, required_tags=additional_tags)
95+
96+
self.step(3)
97+
# Verify that the CurrentMode attribute has a valid value.
98+
mode = self.cluster.Attributes.CurrentMode
99+
await self.read_and_check_mode(endpoint=endpoint, mode=mode, supported_modes=supported_modes)
100+
logger.info(f'Step #4: cluster Attributes({vars(self.cluster.Attributes)})')
101+
102+
# self.step(4)
103+
# # Verify that the OnMode attribute has a valid value or null.
104+
# mode = self.cluster.Attributes.OnMode
105+
# await self.read_and_check_mode(endpoint=endpoint, mode=mode,
106+
# supported_modes=supported_modes, is_nullable=True)
107+
108+
# self.step(5)
109+
# # Verify that the StartUpMode has a valid value or null
110+
# mode = self.cluster.Attributes.StartUpMode
111+
# await self.read_and_check_mode(endpoint=endpoint, mode=mode,
112+
# supported_modes=supported_modes, is_nullable=True)
113+
114+
115+
if __name__ == "__main__":
116+
default_matter_test_main()

0 commit comments

Comments
 (0)