Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))