def test_setup_missing_schema(self): """Test setup with resource missing schema.""" assert not run_coroutine_threadsafe( rest.async_setup_platform(self.hass, { 'platform': 'rest', 'resource': 'localhost' }, None), self.hass.loop).result()
def test_setup_missing_config(self): """Test setup with configuration missing required entries.""" assert not asyncio.run_coroutine_threadsafe( rest.async_setup_platform(self.hass, {CONF_PLATFORM: rest.DOMAIN}, None), self.hass.loop, ).result()
def test_setup_missing_config(self): """Test setup with configuration missing required entries.""" assert not run_coroutine_threadsafe( rest.async_setup_platform(self.hass, { 'platform': 'rest' }, None), self.hass.loop ).result()
def test_setup_timeout(self, aioclient_mock): """Test setup when connection timeout occurs.""" aioclient_mock.get('http://localhost', exc=asyncio.TimeoutError()) assert not run_coroutine_threadsafe( rest.async_setup_platform(self.hass, { 'platform': 'rest', 'resource': 'http://localhost', }, None), self.hass.loop).result()
def test_setup_missing_schema(self): """Test setup with resource missing schema.""" assert not run_coroutine_threadsafe( rest.async_setup_platform(self.hass, { 'platform': 'rest', 'resource': 'localhost' }, None), self.hass.loop ).result()
def test_setup_missing_schema(self): """Test setup with resource missing schema.""" assert not asyncio.run_coroutine_threadsafe( rest.async_setup_platform(self.hass, { "platform": "rest", "resource": "localhost" }, None), self.hass.loop, ).result()
def test_setup_timeout(self, aioclient_mock): """Test setup when connection timeout occurs.""" aioclient_mock.get('http://localhost', exc=asyncio.TimeoutError()) assert not run_coroutine_threadsafe( rest.async_setup_platform(self.hass, { 'platform': 'rest', 'resource': 'http://localhost', }, None), self.hass.loop ).result()
def test_setup_timeout(self, aioclient_mock): """Test setup when connection timeout occurs.""" aioclient_mock.get("http://localhost", exc=asyncio.TimeoutError()) assert not asyncio.run_coroutine_threadsafe( rest.async_setup_platform(self.hass, { "platform": "rest", "resource": "http://localhost" }, None), self.hass.loop, ).result()
def test_setup_failed_connect(self, aioclient_mock): """Test setup when connection error occurs.""" 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()
def test_setup_missing_schema(self): """Test setup with resource missing schema.""" assert not asyncio.run_coroutine_threadsafe( rest.async_setup_platform( self.hass, { CONF_PLATFORM: rest.DOMAIN, CONF_RESOURCE: "localhost" }, None, ), self.hass.loop, ).result()
def test_setup_timeout(self, aioclient_mock): """Test setup when connection timeout occurs.""" aioclient_mock.get("http://localhost", exc=asyncio.TimeoutError()) assert not asyncio.run_coroutine_threadsafe( rest.async_setup_platform( self.hass, { CONF_PLATFORM: rest.DOMAIN, CONF_RESOURCE: "http://localhost" }, None, ), self.hass.loop, ).result()
def test_setup_missing_config(self): """Test setup with configuration missing required entries.""" assert not run_coroutine_threadsafe( rest.async_setup_platform(self.hass, {"platform": "rest"}, None), self.hass.loop, ).result()