Ejemplo n.º 1
0
 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()
Ejemplo n.º 2
0
 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()
Ejemplo n.º 3
0
 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()
Ejemplo n.º 4
0
 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()
Ejemplo n.º 5
0
 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()
Ejemplo n.º 6
0
 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()