Skip to content

Commit

Permalink
Test an illegal slot index == number of slots in a forecast
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterC1965 committed Aug 20, 2024
1 parent 5bdddd1 commit 20e44e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/python_testing/TC_DEM_2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def steps_TC_DEM_2_5(self) -> list[TestStep]:
"Value has to be 0x00 (NoOptOut)"),
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",
"Verify DUT responds w/ status FAILURE(0x01)"),
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",
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",
"Verify DUT responds w/ status FAILURE(0x01)"),
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",
"Verify DUT responds w/ status CONSTRAINT_ERROR(0x87)"),
Expand Down Expand Up @@ -177,7 +177,7 @@ async def test_TC_DEM_2_5(self):

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

self.step("7")
Expand Down

0 comments on commit 20e44e9

Please sign in to comment.