aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/core/test_vnf.py
diff options
context:
space:
mode:
Diffstat (limited to 'functest/tests/unit/core/test_vnf.py')
-rw-r--r--functest/tests/unit/core/test_vnf.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/functest/tests/unit/core/test_vnf.py b/functest/tests/unit/core/test_vnf.py
index 16a609027..086ee6821 100644
--- a/functest/tests/unit/core/test_vnf.py
+++ b/functest/tests/unit/core/test_vnf.py
@@ -128,6 +128,9 @@ class VnfBaseTesting(unittest.TestCase):
args[2].assert_not_called()
@mock.patch('functest.core.vnf.OpenStackUser', side_effect=Exception)
+ @mock.patch('snaps.openstack.utils.keystone_utils.get_role_by_name',
+ return_value="admin")
+ @mock.patch('snaps.openstack.utils.keystone_utils.keystone_client')
@mock.patch('functest.core.vnf.OpenStackProject')
@mock.patch('snaps.openstack.tests.openstack_tests.get_credentials')
def test_prepare_exc3(self, *args):
@@ -135,16 +138,23 @@ class VnfBaseTesting(unittest.TestCase):
self.test.prepare()
args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file)
args[1].assert_called_with(mock.ANY, mock.ANY)
- args[2].assert_called_with(mock.ANY, mock.ANY)
+ args[2].assert_called_with(mock.ANY)
+ args[3].assert_called_with(mock.ANY, mock.ANY)
+ args[4].assert_called_with(mock.ANY, mock.ANY)
@mock.patch('functest.core.vnf.OpenStackUser')
+ @mock.patch('snaps.openstack.utils.keystone_utils.get_role_by_name',
+ return_value="admin")
+ @mock.patch('snaps.openstack.utils.keystone_utils.keystone_client')
@mock.patch('functest.core.vnf.OpenStackProject')
@mock.patch('snaps.openstack.tests.openstack_tests.get_credentials')
def test_prepare_default(self, *args):
self.assertEqual(self.test.prepare(), testcase.TestCase.EX_OK)
args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file)
args[1].assert_called_with(mock.ANY, mock.ANY)
- args[2].assert_called_with(mock.ANY, mock.ANY)
+ args[2].assert_called_with(mock.ANY)
+ args[3].assert_called_with(mock.ANY, mock.ANY)
+ args[4].assert_called_with(mock.ANY, mock.ANY)
def test_deploy_vnf_unimplemented(self):
with self.assertRaises(vnf.VnfDeploymentException):