From 05fb960bb689ab2ce8b5601dd1a186532778a0d8 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 16 Feb 2018 19:07:13 +0100 Subject: Mock additional methods related to OpenStackFlavor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- functest/tests/unit/openstack/vping/test_vping.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'functest/tests/unit/openstack/vping/test_vping.py') diff --git a/functest/tests/unit/openstack/vping/test_vping.py b/functest/tests/unit/openstack/vping/test_vping.py index 42650dea..91cf2259 100644 --- a/functest/tests/unit/openstack/vping/test_vping.py +++ b/functest/tests/unit/openstack/vping/test_vping.py @@ -50,6 +50,8 @@ class VPingUserdataTesting(unittest.TestCase): @mock.patch('snaps.openstack.utils.deploy_utils.create_vm_instance') @mock.patch('os.path.exists', return_value=True) + @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) @mock.patch('snaps.openstack.create_instance.OpenStackVmInstance.' @@ -99,6 +101,8 @@ class VPingSSHTesting(unittest.TestCase): @mock.patch('snaps.openstack.utils.deploy_utils.create_vm_instance') @mock.patch('os.path.exists', return_value=True) + @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) @mock.patch('snaps.openstack.create_instance.OpenStackVmInstance.' -- cgit 1.2.3-korg