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.create_image import CreateImage
15 class CreateImageTestCase(unittest.TestCase):
17 @mock.patch('yardstick.common.openstack_utils.create_image')
18 @mock.patch('yardstick.common.openstack_utils.get_glance_client')
19 def test_create_image(self, mock_get_glance_client, mock_create_image):
21 'image_name': 'yardstick_test_image_01',
22 'disk_format': 'qcow2',
23 'container_format': 'bare',
27 'tags': '["yardstick automatic test image"]',
28 'file_path': '/home/opnfv/images/cirros-0.3.5-x86_64-disk.img'
30 args = {"options": options}
31 obj = CreateImage(args, {})
33 self.assertTrue(mock_create_image.called)
40 if __name__ == '__main__':