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)
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", "method": "GET"}, lambda devices, update=True: None, )
def test_setup_missing_schema(self): """Test setup with resource missing schema.""" with pytest.raises(PlatformNotReady): rest.setup_platform( self.hass, {"platform": "rest", "resource": "localhost", "method": "GET"}, None, )
def test_setup_missing_schema(self): """Test setup with resource missing schema.""" with pytest.raises(MissingSchema): rest.setup_platform(self.hass, { 'platform': 'rest', 'resource': 'localhost', 'method': 'GET' }, None)
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)
def test_setup_missing_schema(self): """Test setup with resource missing schema.""" with pytest.raises(MissingSchema): rest.setup_platform(self.hass, { 'platform': 'rest', 'resource': 'localhost', 'method': 'GET' }, None)