1 ##############################################################################
2 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
12 from yardstick.benchmark.scenarios.lib.delete_image import DeleteImage
15 class DeleteImageTestCase(unittest.TestCase):
17 @mock.patch('yardstick.common.openstack_utils.delete_image')
18 @mock.patch('yardstick.common.openstack_utils.get_image_id')
19 @mock.patch('yardstick.common.openstack_utils.get_glance_client')
20 def test_delete_image(self, mock_get_glance_client, mock_image_id, mock_delete_image):
22 'image_name': 'yardstick_test_image_01'
24 args = {"options": options}
25 obj = DeleteImage(args, {})
27 self.assertTrue(mock_delete_image.called)
28 self.assertTrue(mock_image_id.called)
29 self.assertTrue(mock_get_glance_client.called)
36 if __name__ == '__main__':