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 import create_image
13 from yardstick.common import openstack_utils
15 # NOTE(elfoley): There should be more tests here.
16 class CreateImageTestCase(unittest.TestCase):
18 @mock.patch.object(openstack_utils, 'create_image')
19 @mock.patch.object(openstack_utils, 'get_glance_client')
20 def test_create_image(self, mock_get_glance_client, mock_create_image):
22 'image_name': 'yardstick_test_image_01',
23 'disk_format': 'qcow2',
24 'container_format': 'bare',
28 'tags': '["yardstick automatic test image"]',
29 'file_path': '/home/opnfv/images/cirros-0.3.5-x86_64-disk.img'
31 args = {"options": options}
32 obj = create_image.CreateImage(args, {})
34 mock_create_image.assert_called_once()
35 mock_get_glance_client.assert_called_once()