Smarthome Functionen
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_heating_function.py 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from function.modules import heating_function as test_class
  2. """
  3. config.DEFAULT_TEMPERATURE[heating_valve.topic],
  4. db_data = get_radiator_data(heating_valve.topic)
  5. **{
  6. test_class.KEY_USER_TEMPERATURE_SETPOINT: db_data[2],
  7. test_class.KEY_TEMPERATURE_SETPOINT: db_data[3],
  8. test_class.KEY_AWAY_MODE: db_data[0],
  9. test_class.KEY_SUMMER_MODE: db_data[1],
  10. })
  11. """
  12. def test_initial_states():
  13. class heating_valve(object):
  14. KEY_HEATING_SETPOINT = 'hsp'
  15. KEY_TEMPERATURE = 'temp'
  16. def set_heating_setpoint(self, value):
  17. pass
  18. def add_callback(self, key, value, callback):
  19. pass
  20. #
  21. #
  22. #
  23. tc = test_class(
  24. heating_valve(),
  25. 21, **{
  26. test_class.KEY_USER_TEMPERATURE_SETPOINT: 22,
  27. test_class.KEY_TEMPERATURE_SETPOINT: 17,
  28. test_class.KEY_AWAY_MODE: True,
  29. test_class.KEY_SUMMER_MODE: False,
  30. })
  31. assert tc.get(test_class.KEY_USER_TEMPERATURE_SETPOINT) == 22
  32. assert tc.get(test_class.KEY_TEMPERATURE_SETPOINT) == 17
  33. assert tc.get(test_class.KEY_AWAY_MODE) == True
  34. assert tc.get(test_class.KEY_SUMMER_MODE) == False