def test_if_applicable_hook_on(self): """Test test_if_applicable method with hook set to 'on'.""" xknx = XKNX(loop=self.loop) action = ActionBase(xknx, counter=2, hook="on") self.assertTrue(action.test_if_applicable(True, 2)) self.assertFalse(action.test_if_applicable(True, 3)) self.assertFalse(action.test_if_applicable(False, 2))
def test_if_applicable_hook_off(self): """Test test_if_applicable method with hook set to 'off'.""" xknx = XKNX(loop=self.loop) action = ActionBase(xknx, counter=2, hook="off") self.assertTrue(action.test_if_applicable(BinarySensorState.OFF, 2)) self.assertFalse(action.test_if_applicable(BinarySensorState.OFF, 3)) self.assertFalse(action.test_if_applicable(BinarySensorState.ON, 2))
def test_if_applicable_hook_off(self): """Test test_if_applicable method with hook set to 'off'.""" xknx = XKNX(loop=self.loop) action = ActionBase(xknx, counter=2, hook="off") self.assertTrue(action.test_if_applicable( BinarySensorState.OFF, 2)) self.assertFalse(action.test_if_applicable( BinarySensorState.OFF, 3)) self.assertFalse(action.test_if_applicable( BinarySensorState.ON, 2))