예제 #1
0
 def test_setup_timeout(self, mock_req):
     """Test setup when connection timeout occurs."""
     with raises(PlatformNotReady):
         rest.setup_platform(self.hass, {
             'platform': 'rest',
             'resource': 'http://localhost',
         }, lambda devices, update=True: None)
예제 #2
0
 def test_setup_missing_schema(self):
     """Test setup with resource missing schema."""
     with self.assertRaises(MissingSchema):
         rest.setup_platform(self.hass, {
             'platform': 'rest',
             'resource': 'localhost',
             'method': 'GET'
         }, None)
예제 #3
0
 def test_setup_missing_schema(self):
     """Test setup with resource missing schema."""
     with self.assertRaises(MissingSchema):
         rest.setup_platform(self.hass, {
             'platform': 'rest',
             'resource': 'localhost',
             'method': 'GET'
         }, None)
예제 #4
0
 def test_setup_timeout(self, mock_req):
     """Test setup when connection timeout occurs."""
     with raises(PlatformNotReady):
         rest.setup_platform(self.hass, {
             'platform': 'rest',
             'resource': 'http://localhost',
         },
                             lambda devices, update=True: None)
예제 #5
0
 def test_setup_timeout(self, mock_req):
     """Test setup when connection timeout occurs."""
     self.assertFalse(
         rest.setup_platform(self.hass, {
             'platform': 'rest',
             'resource': 'http://localhost',
         }, None))
예제 #6
0
 def test_setup_missing_config(self):
     """Test setup with configuration missing required entries."""
     self.assertFalse(
         rest.setup_platform(self.hass, {
             'platform': 'rest',
             'resource': 'http://localhost'
         }, None))
예제 #7
0
 def test_setup_timeout(self, mock_req):
     """Test setup when connection timeout occurs."""
     self.assertTrue(
         rest.setup_platform(self.hass, {
             'platform': 'rest',
             'resource': 'http://localhost',
         },
                             lambda devices, update=True: None) is None)
예제 #8
0
 def test_setup_timeout(self, mock_req):
     """Test setup when connection timeout occurs."""
     self.assertFalse(rest.setup_platform(self.hass, {
         'platform': 'rest',
         'resource': 'http://localhost',
     }, None))
예제 #9
0
 def test_setup_missing_config(self):
     """Test setup with configuration missing required entries."""
     self.assertFalse(rest.setup_platform(self.hass, {
         'platform': 'rest',
         'resource': 'http://localhost'
     }, None))
예제 #10
0
 def test_setup_timeout(self, mock_req):
     """Test setup when connection timeout occurs."""
     self.assertTrue(rest.setup_platform(self.hass, {
         'platform': 'rest',
         'resource': 'http://localhost',
     }, lambda devices, update=True: None) is None)