From fc8c416f71dbddc71ba74314fedecb8c055c4c27 Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Mon, 23 Dec 2024 19:40:09 +0100 Subject: [PATCH] add test case --- tests/test_Vitocal111S.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/test_Vitocal111S.py diff --git a/tests/test_Vitocal111S.py b/tests/test_Vitocal111S.py new file mode 100644 index 0000000..f09a04f --- /dev/null +++ b/tests/test_Vitocal111S.py @@ -0,0 +1,32 @@ +import unittest + +from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError +from PyViCare.PyViCareVentilationDevice import VentilationDevice +from tests.ViCareServiceMock import ViCareServiceMock + + +class Vitocal200(unittest.TestCase): + def setUp(self): + self.service = ViCareServiceMock('response/Vitocal111S.json') + self.device = VentilationDevice(self.service) + + def test_ventilation_state(self): + self.assertEqual(self.device.getVentilationDemand(), "ventilation") + self.assertEqual(self.device.getVentilationLevel(), "levelOne") + self.assertEqual(self.device.getVentilationReason(), "schedule") + + def test_ventilationQuickmode(self): + # quickmodes disabled + with self.assertRaises(PyViCareNotSupportedFeatureError): + self.device.getVentilationQuickmode("comfort") + with self.assertRaises(PyViCareNotSupportedFeatureError): + self.device.getVentilationQuickmode("eco") + with self.assertRaises(PyViCareNotSupportedFeatureError): + self.device.getVentilationQuickmode("holiday") + + def test_ventilationQuickmodes(self): + self.assertEqual(self.device.getVentilationQuickmodes(), [ + "comfort", + "eco", + "holiday", + ])