'Test setup when connection error occurs.'

def test_setup_failed_connect(self, aioclient_mock):

    aioclient_mock.get('http://localhost', exc=aiohttp.ClientError)
    assert (not run_coroutine_threadsafe(rest.async_setup_platform(self.hass, {'platform': 'rest', 'resource': 'http://localhost'}, None), self.hass.loop).result())
