Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions tests/test_TestForMissingProperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,46 @@ def __init__(self, filename, path):


class TestForMissingProperties(unittest.TestCase):

def test_deprecatedProperties(self):
# with this test we want to check if properties are marked as deprecated in the response files

mitigated = [
'heating.buffer.sensors.temperature.main',
'heating.buffer.sensors.temperature.top',
'heating.configuration.dhw.temperature.dhwCylinder.max',
'heating.dhw.sensors.temperature.hotWaterStorage',
'heating.dhw.sensors.temperature.hotWaterStorage.top',
'heating.dhw.sensors.temperature.hotWaterStorage.middle',
'heating.dhw.sensors.temperature.hotWaterStorage.bottom',
'heating.circuits.0.operating.programs.summerEco',
]
# the usage of these data points need to be fixed
todo = [
'ventilation.operating.programs.eco',
'ventilation.operating.programs.comfort',
'ventilation.operating.programs.holiday',
'ventilation.operating.programs.levelOne',
'ventilation.operating.programs.levelTwo',
'ventilation.operating.programs.levelThree',
'ventilation.operating.programs.levelFour',
'ventilation.operating.programs.forcedLevelFour',
'ventilation.operating.programs.silent',
]

all_features = self.read_all_features()

deprecated_features = {}
for feature in all_features:
if len(deprecated_features) < 3 and "deprecated" in all_features[feature]:
deprecated_features[feature] = all_features[feature]["deprecated"]

# self.assertDictEqual({}, deprecated_features)
for feature in deprecated_features:
if feature not in todo and feature not in mitigated:
self.fail(f"{feature} is deprecated ({deprecated_features[feature]})")


def test_missingProperties(self):
# with this test we want to check if new properties
# are added to the response files
Expand Down Expand Up @@ -173,6 +213,9 @@ def read_all_features(self):
if name not in all_features:
all_features[name] = {'files': []}

if "deprecated" in feature:
all_features[name]['deprecated'] = feature["deprecated"]["info"]

if feature['isEnabled'] and feature['properties'] != {}:
all_features[name]['files'].append(response)
return all_features