'Test device connection with device raising an exception.'

@mock.patch('libpurecoollink.dyson.DysonAccount.devices', return_value=[_get_dyson_account_device_error()])
@mock.patch('libpurecoollink.dyson.DysonAccount.login', return_value=True)
def test_dyson_custom_conf_device_error(self, mocked_login, mocked_devices):

    dyson.setup(self.hass, {dyson.DOMAIN: {dyson.CONF_USERNAME: 'email', dyson.CONF_PASSWORD: 'password', dyson.CONF_LANGUAGE: 'FR', dyson.CONF_DEVICES: [{'device_id': 'XX-XXXXX-XX', 'device_ip': '192.168.0.1'}]}})
    self.assertEqual(mocked_login.call_count, 1)
    self.assertEqual(mocked_devices.call_count, 1)
    self.assertEqual(len(self.hass.data[dyson.DYSON_DEVICES]), 0)
