Skip to content

Commit

Permalink
Restyled by autopep8
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and nivi-apple committed Aug 28, 2024
1 parent 77f1d17 commit 23266ac
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/python_testing/TC_TSTAT_4_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ async def test_TC_TSTAT_4_2(self):
# Calculate the length of the Presets list that could be created using the preset scenarios in PresetTypes and numberOfPresets supported for each scenario.
totalExpectedPresetsLength = 0
for presetType in presetTypes:
totalExpectedPresetsLength += presetType.numberOfPresets;
totalExpectedPresetsLength += presetType.numberOfPresets

if totalExpectedPresetsLength > numberOfPresetsSupported:
testPresets = []
Expand All @@ -519,16 +519,16 @@ async def test_TC_TSTAT_4_2(self):
countNumberOfPresetsAdded = 0
for testPreset in testPresets:
if testPreset.presetScenario == scenario:
++countNumberOfPresetsAdded;
++countNumberOfPresetsAdded

if countNumberOfPresetsAdded < presetType.numberOfPresets:
testPresets.append(cluster.Structs.PresetStruct(presetHandle=NullValue, presetScenario=scenario,
name="Preset", coolingSetpoint=2500, heatingSetpoint=1700, builtIn=False))
name="Preset", coolingSetpoint=2500, heatingSetpoint=1700, builtIn=False))
++countNumberOfPresetsAdded
elif not didCopyPreset and not len(testPresets) > numberOfPresetsSupported:
for index in range(presetType.numberOfPresets):
testPresets.append(cluster.Structs.PresetStruct(presetHandle=NullValue, presetScenario=scenario,
name="Preset", coolingSetpoint=2500, heatingSetpoint=1700, builtIn=False))
name="Preset", coolingSetpoint=2500, heatingSetpoint=1700, builtIn=False))

# Since for built in presets, we can't add any more entries. That might cause the size of testPresets not to exceed the number of presets supported.
# If so, skip the test.
Expand All @@ -543,7 +543,9 @@ async def test_TC_TSTAT_4_2(self):
# Clear state for next test.
await self.send_atomic_request_rollback_command()
else:
logger.info(f"Couldn't run test step 18 since there are not enough preset types to build a Presets list that exceeds the number of presets supported")
logger.info(
f"Couldn't run test step 18 since there are not enough preset types to build a Presets list that exceeds the number of presets supported")


if __name__ == "__main__":
default_matter_test_main()

0 comments on commit 23266ac

Please sign in to comment.