'Test turning the switch on and off.'

def test_on_off(self):

    assert (self.switch().state == 'off')
    assert (self.other_switch().state == 'off')
    assert (not switch.is_on(self.hass, ENTITY_SWITCH))
    switch.turn_on(self.hass, ENTITY_SWITCH)
    self.hass.block_till_done()
    self.mock_lj.press_switch.assert_called_with(ENTITY_SWITCH_NUMBER)
    switch.turn_off(self.hass, ENTITY_SWITCH)
    self.hass.block_till_done()
    self.mock_lj.release_switch.assert_called_with(ENTITY_SWITCH_NUMBER)
