예제 #1
0
    def test_toggle(self):
        """Test toggle method."""
        runs = []
        self.hass.services.register("light", SERVICE_TOGGLE, lambda x: runs.append(1))

        comps.toggle(self.hass, "light.Bowl")

        self.hass.pool.block_till_done()

        self.assertEqual(1, len(runs))
예제 #2
0
    def test_toggle(self):
        """Test toggle method."""
        runs = []
        self.hass.services.register('light', SERVICE_TOGGLE,
                                    lambda x: runs.append(1))

        comps.toggle(self.hass, 'light.Bowl')

        self.hass.pool.block_till_done()

        self.assertEqual(1, len(runs))
예제 #3
0
 def test_toggle(self):
     """Test toggle method."""
     calls = mock_service(self.hass, 'light', SERVICE_TOGGLE)
     comps.toggle(self.hass, 'light.Bowl')
     self.hass.block_till_done()
     self.assertEqual(1, len(calls))
예제 #4
0
 def test_toggle(self):
     """Test toggle method."""
     calls = mock_service(self.hass, 'light', SERVICE_TOGGLE)
     comps.toggle(self.hass, 'light.Bowl')
     self.hass.block_till_done()
     self.assertEqual(1, len(calls))