diff options
author | valentin boucher <valentin.boucher@kontron.com> | 2018-02-28 14:49:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-02-28 14:49:11 +0000 |
commit | 5d6cce702590f6bcf340a99343edba8c251534e1 (patch) | |
tree | 58cc61547fdcde461d7591448ccf5167a8d7539d /functest/tests/unit | |
parent | ff4817eb5e7e11780353c73a9c7d0f40948863be (diff) | |
parent | f15f1764ae1531e086a68d6070964a8b6c60a987 (diff) |
Merge "Support different user/project domain values"
Diffstat (limited to 'functest/tests/unit')
-rw-r--r-- | functest/tests/unit/core/test_vnf.py | 14 |
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 0ac672f6c..dbdcc0f05 100644 --- a/functest/tests/unit/core/test_vnf.py +++ b/functest/tests/unit/core/test_vnf.py @@ -129,6 +129,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): @@ -136,16 +139,23 @@ class VnfBaseTesting(unittest.TestCase): self.test.prepare() args[0].assert_called_with(os_env_file=constants.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=constants.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): |