X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=functest%2Ftests%2Funit%2Fcore%2Ftest_vnf.py;h=086ee6821088685992ba9ad80f828f97601c2175;hb=f15f1764ae1531e086a68d6070964a8b6c60a987;hp=16a60902741b8a3883a74f56ae244a99afc0bf89;hpb=78a21107e377f4f4722fd8d570dc0394f6ae5692;p=functest.git 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):