'Test update when switch is on.'

def test_update_when_on(self, aioclient_mock):

    aioclient_mock.get(self.resource, text=self.body_on.template)
    run_coroutine_threadsafe(self.switch.async_update(), self.hass.loop).result()
    assert self.switch.is_on
