Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
CFenner committed Dec 23, 2024
1 parent ef6f4c7 commit fc8c416
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/test_Vitocal111S.py
Original file line number Diff line number Diff line change
@@ -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",
])

0 comments on commit fc8c416

Please sign in to comment.