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 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_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()