'Test get_image_id when sahara raises an exception.'

def test_get_image_id_sahara_exception(self):

    img_name = str(uuid.uuid4())
    self.sahara_client.images.find.side_effect = [sahara_base.APIException(error_message='Error', error_code=404)]
    expected_error = 'Error    retrieving    images    list    from    sahara:    Error'
    e = self.assertRaises(exception.Error, self.sahara_plugin.find_resource_by_name, 'images', img_name)
    self.assertEqual(expected_error, six.text_type(e))
    self.sahara_client.images.find.assert_called_once_with(name=img_name)
