'Test setup when connection error occurs.'

@patch('requests.Session.send', side_effect=requests.exceptions.ConnectionError())
def test_setup_failed_connect(self, mock_req):

    self.assertFalse(rest.setup_platform(self.hass, {'platform': 'rest', 'resource': 'http://localhost'}, None))
