Skip to content

Commit 20e44e9

Browse files
committed
Test an illegal slot index == number of slots in a forecast
1 parent 5bdddd1 commit 20e44e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/python_testing/TC_DEM_2_5.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def steps_TC_DEM_2_5(self) -> list[TestStep]:
7474
"Value has to be 0x00 (NoOptOut)"),
7575
TestStep("5", "TH sends command ModifyForecastRequest with ForecastID=Forecast.ForecastID+1, SlotAdjustments[0].{SlotIndex=0, NominalPower=Forecast.Slots[0].MinPowerAdjustment, Duration=Forecast.Slots[0].MaxDurationAdjustment}, Cause=GridOptimization",
7676
"Verify DUT responds w/ status FAILURE(0x01)"),
77-
TestStep("6", "TH sends command ModifyForecastRequest with ForecastID=Forecast.ForecastID, SlotAdjustments[0].{SlotIndex=4, NominalPower=Forecast.Slots[0].MinPowerAdjustment, Duration=Forecast.Slots[0].MaxDurationAdjustment}, Cause=GridOptimization",
77+
TestStep("6", "TH sends command ModifyForecastRequest with ForecastID=Forecast.ForecastID, SlotAdjustments[0].{SlotIndex=len(Forecast.Slots), NominalPower=Forecast.Slots[0].MinPowerAdjustment, Duration=Forecast.Slots[0].MaxDurationAdjustment}, Cause=GridOptimization",
7878
"Verify DUT responds w/ status FAILURE(0x01)"),
7979
TestStep("7", "TH sends command ModifyForecastRequest with ForecastID=Forecast.ForecastID, SlotAdjustments[0].{SlotIndex=0, NominalPower=Forecast.Slots[0].MinPowerAdjustment-1, Duration=Forecast.Slots[0].MaxDurationAdjustment}, Cause=GridOptimization",
8080
"Verify DUT responds w/ status CONSTRAINT_ERROR(0x87)"),
@@ -177,7 +177,7 @@ async def test_TC_DEM_2_5(self):
177177

178178
self.step("6")
179179
slotAdjustments = [Clusters.DeviceEnergyManagement.Structs.SlotAdjustmentStruct(
180-
slotIndex=4, nominalPower=forecast.slots[0].minPowerAdjustment, duration=forecast.slots[0].maxDurationAdjustment)]
180+
slotIndex=len(forecast.slots), nominalPower=forecast.slots[0].minPowerAdjustment, duration=forecast.slots[0].maxDurationAdjustment)]
181181
await self.send_modify_forecast_request_command(forecast.forecastID, slotAdjustments, Clusters.DeviceEnergyManagement.Enums.AdjustmentCauseEnum.kGridOptimization, expected_status=Status.Failure)
182182

183183
self.step("7")

0 commit comments

Comments
 (0)