[HSTAT] Add test scripts for the Humidistat cluster. - #72820
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Code Review
This pull request introduces two new Python test scripts for the HSTAT cluster: TC_HSTAT_2.2.py and TC_HSTAT_2_1.py. However, TC_HSTAT_2.2.py is incomplete, containing only imports and logger initialization. TC_HSTAT_2_1.py contains several syntax errors, including a missing closing quote in the description method and a missing comma between steps 41 and 42. Additionally, there are multiple missing commas within several TestStep definitions (steps 14, 25, 27, and 31) causing implicit string concatenation, a copy-paste typo in the step method name, copy-paste errors in several step descriptions (steps 7, 8, 11, and 41), and a missing test execution method and main block.
I am having trouble creating individual review comments. Click here to see my feedback.
src/python_testing/TC_HSTAT_2.2.py (51)
The test script TC_HSTAT_2.2.py is incomplete. It only contains imports and logger initialization, but lacks the test class definition, test steps, test methods, and the main execution block. Please implement the full test script.
src/python_testing/TC_HSTAT_2_1.py (55-56)
There is a syntax error due to a missing closing double quote on the return string of desc_TC_HSTAT_2_1.
def desc_TC_HSTAT_2_1(self) -> str:
return "[TC-HSTAT-2.1] Primary functionality with DUT as Server"src/python_testing/TC_HSTAT_2_1.py (169)
The test script is missing the actual test execution method (e.g., test_TC_HSTAT_2_1 decorated with @async_test_body) and the main execution block (if __name__ == '__main__': default_matter_test_main()). Without these, the test steps will not be executed when the script is run. Note that default_matter_test_main should be imported from matter.testing.runner.
References
- In the Matter Python testing framework, the
default_matter_test_mainfunction is located in and should be imported frommatter.testing.runner.
src/python_testing/TC_HSTAT_2_1.py (58)
The method name steps_TC_FAN_2_1 is a copy-paste typo from the Fan Control cluster tests. It should be renamed to steps_TC_HSTAT_2_1 to match the class name TC_HSTAT_2_1.
def steps_TC_HSTAT_2_1(self):src/python_testing/TC_HSTAT_2_1.py (90-91)
There is a missing comma between the description and expectation string arguments in TestStep(14). This causes Python to implicitly concatenate them into a single string argument.
TestStep(14, "TH writes to the DUT the Mode attribute with a value of Humidifier",
"Verify DUT responds w/ status SUCCESS(0x00)"),src/python_testing/TC_HSTAT_2_1.py (112-113)
There is a missing comma between the description and expectation string arguments in TestStep(25). This causes Python to implicitly concatenate them into a single string argument.
TestStep(25, "TH writes to the DUT the UserSetpoint attribute with value MinSetpointValue.",
"Verify DUT responds w/ status SUCCESS(0x00)"),src/python_testing/TC_HSTAT_2_1.py (116-117)
There is a missing comma between the description and expectation string arguments in TestStep(27). This causes Python to implicitly concatenate them into a single string argument.
TestStep(27, "TH writes to the DUT the UserSetpoint attribute with value MaxSetpointValue.",
"Verify DUT responds w/ status SUCCESS(0x00)"),src/python_testing/TC_HSTAT_2_1.py (124-125)
There is a missing comma between the description and expectation string arguments in TestStep(31). This causes Python to implicitly concatenate them into a single string argument.
TestStep(31, "TH reads from the DUT the Continuous attribute.",
"Store the value as ContState"),src/python_testing/TC_HSTAT_2_1.py (144-146)
Step 41's description is 'Store the value as OptState', which is a copy-paste error. It should be 'TH reads from the DUT the Optimal attribute.' or similar. Additionally, there is a missing comma between TestStep(41) and TestStep(42) in the list, which causes a syntax error.
TestStep(41, "TH reads from the DUT the Optimal attribute.",
"Verify that the DUT response contains !OptState."),
TestStep(42, "TH writes to the DUT the Optimal attribute with a value of False.",src/python_testing/TC_HSTAT_2_1.py (74-79)
The descriptions for Step 7 and Step 8 contain copy-paste errors. Step 7's description is 'Store the value as StepValue.' but it should be 'TH reads from the DUT the UserSetpoint attribute.' or similar. Step 8's description is 'Store the value as SetpointValue.' but it should be 'TH reads from the DUT the UserSetpoint attribute.' or similar.
TestStep(7, "TH reads from the DUT the UserSetpoint attribute.",
"Store the value as SetpointValue. " +
"SetpointValue is between MinSetpointValue and MaxSetpointValue inclusive. " +
"SetpointValue is such that (SetpointValue - MinSetpointValue) % StepValue == 0."),
TestStep(8, "TH reads from the DUT the UserSetpoint attribute.",
"Verify that the DUT response contains a value between MinSetpointValue and MaxSetpointValue inclusive."),src/python_testing/TC_HSTAT_2_1.py (84-85)
Step 11's description is 'Verify that the DUT response contains a value or True or False', which is a copy-paste error. It should be 'TH reads from the DUT the Sleep attribute.' or similar.
TestStep(11, "TH reads from the DUT the Sleep attribute.",
"Verify that the DUT response contains a value or True or False."),for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
PR #72820: Size comparison from d9d3108 to 2e30a68 Full report (6 builds for cc32xx, nrfconnect, realtek, stm32)
|
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
PR #72820: Size comparison from e1978f6 to f926619 Full report (34 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
|
|
PR #72820: Size comparison from 95d3974 to 06a73d9 Full report (22 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, nrfconnect, psoc6, qpg, realtek, stm32)
|
|
PR #72820: Size comparison from 95d3974 to 9ed58db Full report (6 builds for cc32xx, nrfconnect, realtek, stm32)
|
|
PR #72820: Size comparison from 95d3974 to aa38e95 Full report (22 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, nrfconnect, psoc6, qpg, realtek, stm32)
|
|
PR #72820: Size comparison from 95d3974 to 3e84130 Full report (34 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
|
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
Your Name seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Summary
Add test scripts for the Humidistat cluster.
Testing
This is a work in progress, so no testing instructions yet.