aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/openstack/rally/test_rally.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-02-16 19:07:13 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-02-16 19:14:15 +0100
commit05fb960bb689ab2ce8b5601dd1a186532778a0d8 (patch)
treefd5aee660d96596fb1036a4490e903d86348dbaa /functest/tests/unit/openstack/rally/test_rally.py
parent3beed1cd99ae8727441e7b7afcd6e6afc2bb7afb (diff)
Mock additional methods related to OpenStackFlavor
keystone_utils.keystone_client() and keystone_utils.get_project() have to be mocked when unit testing flavor creation since [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/52157/ Change-Id: I898cde1001c14d0b450c3dd43ade7dca47b1ffb3 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/openstack/rally/test_rally.py')
-rw-r--r--functest/tests/unit/openstack/rally/test_rally.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py
index 9cc6bf53d..5d82d91f9 100644
--- a/functest/tests/unit/openstack/rally/test_rally.py
+++ b/functest/tests/unit/openstack/rally/test_rally.py
@@ -329,6 +329,8 @@ class OSRallyTesting(unittest.TestCase):
@mock.patch('snaps.openstack.utils.deploy_utils.create_image')
@mock.patch('snaps.openstack.utils.deploy_utils.create_network')
@mock.patch('snaps.openstack.utils.deploy_utils.create_router')
+ @mock.patch('snaps.openstack.utils.keystone_utils.keystone_client')
+ @mock.patch('snaps.openstack.utils.keystone_utils.get_project')
@mock.patch('snaps.openstack.create_flavor.OpenStackFlavor.create',
return_value=None)
def test_prepare_env_flavor_creation_failed(self, mock_create_flavor,
@@ -348,6 +350,8 @@ class OSRallyTesting(unittest.TestCase):
@mock.patch('snaps.openstack.utils.deploy_utils.create_image')
@mock.patch('snaps.openstack.utils.deploy_utils.create_network')
@mock.patch('snaps.openstack.utils.deploy_utils.create_router')
+ @mock.patch('snaps.openstack.utils.keystone_utils.keystone_client')
+ @mock.patch('snaps.openstack.utils.keystone_utils.get_project')
@mock.patch('snaps.openstack.create_flavor.OpenStackFlavor.create',
side_effect=[mock.Mock, None])
def test_prepare_env_flavor_alt_creation_failed(self, mock_create_flavor,