diff options
Diffstat (limited to 'functest/tests/unit/vnf/router/test_cloudify_vrouter.py')
-rw-r--r-- | functest/tests/unit/vnf/router/test_cloudify_vrouter.py | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/functest/tests/unit/vnf/router/test_cloudify_vrouter.py b/functest/tests/unit/vnf/router/test_cloudify_vrouter.py index 7f2091be..4f256234 100644 --- a/functest/tests/unit/vnf/router/test_cloudify_vrouter.py +++ b/functest/tests/unit/vnf/router/test_cloudify_vrouter.py @@ -15,8 +15,6 @@ import mock from functest.core import vnf from functest.opnfv_tests.vnf.router import cloudify_vrouter -from snaps.openstack.os_credentials import OSCreds - class CloudifyVrouterTesting(unittest.TestCase): @@ -60,80 +58,10 @@ class CloudifyVrouterTesting(unittest.TestCase): 'vnf': {}, 'test_vnf': {}} - @mock.patch('functest.core.vnf.os_utils.get_keystone_client', - return_value='test') - @mock.patch('functest.core.vnf.os_utils.get_or_create_tenant_for_vnf', - return_value=True) - @mock.patch('functest.core.vnf.os_utils.get_or_create_user_for_vnf', - return_value=True) - @mock.patch('functest.core.vnf.os_utils.get_credentials', - return_value={'auth_url': 'test/v1'}) - @mock.patch('snaps.openstack.create_image.OpenStackImage.create') - def test_prepare_default(self, *args): - self.assertIsNone(self.router_vnf.prepare()) - args[4].assert_called_once_with() - - @mock.patch('functest.core.vnf.os_utils.get_keystone_client', - return_value='test') - @mock.patch('functest.core.vnf.os_utils.get_or_create_tenant_for_vnf', - return_value=True) - @mock.patch('functest.core.vnf.os_utils.get_or_create_user_for_vnf', - return_value=True) - @mock.patch('functest.core.vnf.os_utils.get_credentials', - return_value={'auth_url': 'test/no_v'}) - @mock.patch('snaps.openstack.create_image.OpenStackImage.create') - def test_prepare_bad_auth_url(self, *args): - with self.assertRaises(Exception): - self.router_vnf.image_creator( - OSCreds(username='user', password='pass', auth_url='url', - project_name='project', identity_api_version=3), - mock.Mock()) - args[0].assert_not_called() - def test_prepare_missing_param(self): with self.assertRaises(vnf.VnfPreparationException): self.router_vnf.prepare() - @mock.patch('functest.core.vnf.os_utils.get_keystone_client', - side_effect=Exception) - def test_prepare_keystone_exception(self, *args): - with self.assertRaises(vnf.VnfPreparationException): - self.router_vnf.prepare() - args[0].assert_called_once_with() - - @mock.patch('functest.core.vnf.os_utils.get_keystone_client', - return_value='test') - @mock.patch('functest.core.vnf.os_utils.get_or_create_tenant_for_vnf', - side_effect=Exception) - def test_prepare_tenant_exception(self, *args): - with self.assertRaises(vnf.VnfPreparationException): - self.router_vnf.prepare() - args[1].assert_called_once_with() - - @mock.patch('functest.core.vnf.os_utils.get_keystone_client', - return_value='test') - @mock.patch('functest.core.vnf.os_utils.get_or_create_tenant_for_vnf', - return_value=True) - @mock.patch('functest.core.vnf.os_utils.get_or_create_user_for_vnf', - side_effect=Exception) - def test_prepare_user_exception(self, *args): - with self.assertRaises(vnf.VnfPreparationException): - self.router_vnf.prepare() - args[2].assert_called_once_with() - - @mock.patch('functest.core.vnf.os_utils.get_keystone_client', - return_value='test') - @mock.patch('functest.core.vnf.os_utils.get_or_create_tenant_for_vnf', - return_value=True) - @mock.patch('functest.core.vnf.os_utils.get_or_create_user_for_vnf', - return_value=True) - @mock.patch('functest.core.vnf.os_utils.get_credentials', - side_effect=Exception) - def test_prepare_credentials_exception(self, *args): - with self.assertRaises(vnf.VnfPreparationException): - self.router_vnf.prepare() - args[0].assert_called_once_with() - if __name__ == "__main__": logging.disable(logging.CRITICAL) |