1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
import unittest
from PyViCare.PyViCareHeatPump import HeatPump
from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError
from tests.helper import now_is
from tests.ViCareServiceMock import ViCareServiceMock
class Vitocal222S_with_Vitovent(unittest.TestCase):
def setUp(self):
self.service = ViCareServiceMock('response/Vitocal222S-with-Vitovent.json')
self.device = HeatPump(self.service)
def test_getDomesticHotWaterActiveMode_10_10_time(self):
with now_is('2000-01-01 10:10:00'):
self.assertEqual(
self.device.getDomesticHotWaterActiveMode(), 'normal')
def test_getCurrentDesiredTemperature(self):
self.assertEqual(
self.device.circuits[0].getCurrentDesiredTemperature(), 23)
def test_isDomesticHotWaterDevice(self):
self.assertEqual(self.device.isDomesticHotWaterDevice(), True)
def test_isSolarThermalDevice(self):
self.assertEqual(self.device.isSolarThermalDevice(), False)
def test_isVentilationDevice(self):
self.assertEqual(self.device.isVentilationDevice(), True)
def test_getActiveVentilationMode(self):
self.assertEqual("ventilation", self.device.getActiveVentilationMode())
def test_getVentilationModes(self):
expected_modes = ['standby', 'standard', 'ventilation']
self.assertListEqual(expected_modes, self.device.getVentilationModes())
def test_getVentilationMode(self):
self.assertEqual(False, self.device.getVentilationMode("standby"))
def test_ventilationState(self):
with self.assertRaises(PyViCareNotSupportedFeatureError):
self.device.getVentilationDemand()
with self.assertRaises(PyViCareNotSupportedFeatureError):
self.device.getVentilationLevel()
with self.assertRaises(PyViCareNotSupportedFeatureError):
self.device.getVentilationReason()
def test_ventilationQuickmode(self):
with self.assertRaises(PyViCareNotSupportedFeatureError):
self.device.getVentilationQuickmode("standby")
def test_ventilationQuickmodes(self):
self.assertEqual(self.device.getVentilationQuickmodes(), [])
|