'Test is_on, turn_on, turn_off methods.'

def test_methods(self):

    self.assertTrue(setup_component(self.hass, switch.DOMAIN, {switch.DOMAIN: {CONF_PLATFORM: 'test'}}))
    self.assertTrue(switch.is_on(self.hass))
    self.assertEqual(STATE_ON, self.hass.states.get(switch.ENTITY_ID_ALL_SWITCHES).state)
    self.assertTrue(switch.is_on(self.hass, self.switch_1.entity_id))
    self.assertFalse(switch.is_on(self.hass, self.switch_2.entity_id))
    self.assertFalse(switch.is_on(self.hass, self.switch_3.entity_id))
    switch.turn_off(self.hass, self.switch_1.entity_id)
    switch.turn_on(self.hass, self.switch_2.entity_id)
    self.hass.block_till_done()
    self.assertTrue(switch.is_on(self.hass))
    self.assertFalse(switch.is_on(self.hass, self.switch_1.entity_id))
    self.assertTrue(switch.is_on(self.hass, self.switch_2.entity_id))
    switch.turn_off(self.hass)
    self.hass.block_till_done()
    self.assertFalse(switch.is_on(self.hass))
    self.assertEqual(STATE_OFF, self.hass.states.get(switch.ENTITY_ID_ALL_SWITCHES).state)
    self.assertFalse(switch.is_on(self.hass, self.switch_1.entity_id))
    self.assertFalse(switch.is_on(self.hass, self.switch_2.entity_id))
    self.assertFalse(switch.is_on(self.hass, self.switch_3.entity_id))
    switch.turn_on(self.hass)
    self.hass.block_till_done()
    self.assertTrue(switch.is_on(self.hass))
    self.assertEqual(STATE_ON, self.hass.states.get(switch.ENTITY_ID_ALL_SWITCHES).state)
    self.assertTrue(switch.is_on(self.hass, self.switch_1.entity_id))
    self.assertTrue(switch.is_on(self.hass, self.switch_2.entity_id))
    self.assertTrue(switch.is_on(self.hass, self.switch_3.entity_id))
