Merge "Support different user/project domain values"
authorvalentin boucher <valentin.boucher@kontron.com>
Wed, 28 Feb 2018 14:49:11 +0000 (14:49 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Wed, 28 Feb 2018 14:49:11 +0000 (14:49 +0000)
1  2 
functest/core/vnf.py
functest/opnfv_tests/vnf/ims/cloudify_ims.py
functest/tests/unit/core/test_vnf.py

Simple merge
@@@ -134,18 -136,25 +137,25 @@@ class VnfBaseTesting(unittest.TestCase)
      def test_prepare_exc3(self, *args):
          with self.assertRaises(Exception):
              self.test.prepare()
 -        args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file)
 +        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=vnf.VnfOnBoarding.env_file)
 +        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):