File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ def steps_TC_MWOCTRL_2_2(self) -> list[TestStep]:
42
42
TestStep (2 , "Read the PowerSetting attribute" ),
43
43
TestStep (3 , "Send the SetCookingParameters command" ),
44
44
TestStep (4 , "Read and verify the PowerSetting attribute" ),
45
+ TestStep (5 , "Cause constraint error response" ),
45
46
]
46
47
return steps
47
48
@@ -89,6 +90,14 @@ async def test_TC_MWOCTRL_2_2(self):
89
90
powerValue = await self .read_mwoctrl_attribute_expect_success (endpoint = endpoint , attribute = attributes .PowerSetting )
90
91
asserts .assert_true (powerValue == newPowerValue , "PowerSetting was not correctly set" )
91
92
93
+ self .step (5 )
94
+ newPowerValue = 125
95
+ try :
96
+ await self .send_single_cmd (cmd = commands .SetCookingParameters (powerSetting = newPowerValue ), endpoint = endpoint )
97
+ asserts .assert_fail ("Expected an exception but received none." )
98
+ except InteractionModelError as e :
99
+ asserts .assert_equal (e .status , Status .ConstraintError , "Expected ConstraintError but received a different error." )
100
+
92
101
93
102
if __name__ == "__main__" :
94
103
default_matter_test_main ()
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ def steps_TC_MWOCTRL_2_3(self) -> list[TestStep]:
45
45
TestStep (5 , "Read the PowerSetting attribute" ),
46
46
TestStep (6 , "Send the SetCookingParameters command" ),
47
47
TestStep (7 , "Read and verify the PowerSetting attribute" ),
48
+ TestStep (8 , "Cause constraint error response" ),
48
49
]
49
50
return steps
50
51
@@ -109,6 +110,14 @@ async def test_TC_MWOCTRL_2_3(self):
109
110
powerValue = await self .read_mwoctrl_attribute_expect_success (endpoint = endpoint , attribute = attributes .PowerSetting )
110
111
asserts .assert_true (powerValue == newPowerValue , "PowerSetting was not correctly set" )
111
112
113
+ self .step (8 )
114
+ newPowerValue = maxPowerValue + 1
115
+ try :
116
+ await self .send_single_cmd (cmd = commands .SetCookingParameters (powerSetting = newPowerValue ), endpoint = endpoint )
117
+ asserts .assert_fail ("Expected an exception but received none." )
118
+ except InteractionModelError as e :
119
+ asserts .assert_equal (e .status , Status .ConstraintError , "Expected ConstraintError but received a different response." )
120
+
112
121
113
122
if __name__ == "__main__" :
114
123
default_matter_test_main ()
You can’t perform that action at this time.
0 commit comments