From 0b9923e3e3a61062455600fbddffdc20df7ce9e6 Mon Sep 17 00:00:00 2001 From: Juha Kosonen Date: Mon, 11 Sep 2017 13:43:05 +0300 Subject: Remove volume type handling Rally scenarios don't require volume type to exist as a precondition. Change-Id: Id735346e062af084635fd8f76f3686005b9b8add Signed-off-by: Juha Kosonen --- functest/tests/unit/utils/test_openstack_utils.py | 64 ----------------------- 1 file changed, 64 deletions(-) (limited to 'functest/tests/unit/utils') diff --git a/functest/tests/unit/utils/test_openstack_utils.py b/functest/tests/unit/utils/test_openstack_utils.py index 3bd7e3dd..307cbe37 100644 --- a/functest/tests/unit/utils/test_openstack_utils.py +++ b/functest/tests/unit/utils/test_openstack_utils.py @@ -135,25 +135,8 @@ class OSUtilsTesting(unittest.TestCase): mock_obj.configure_mock(**attrs) self.volume = mock_obj - mock_obj = mock.Mock() - attrs = {'id': 'volume_type_id', - 'name': 'test_volume_type', - 'is_public': True} - mock_obj.configure_mock(**attrs) - self.volume_types = [mock_obj] - - mock_obj = mock.Mock() - attrs = {'id': 'volume_type_id', - 'name': 'test_volume_type', - 'is_public': False} - mock_obj.configure_mock(**attrs) - self.volume_types.append(mock_obj) - self.cinder_client = mock.Mock() attrs = {'volumes.list.return_value': [self.volume], - 'volume_types.list.return_value': self.volume_types, - 'volume_types.create.return_value': self.volume_types[0], - 'volume_types.delete.return_value': mock.Mock(), 'quotas.update.return_value': mock.Mock(), 'volumes.detach.return_value': mock.Mock(), 'volumes.force_delete.return_value': mock.Mock(), @@ -1525,41 +1508,6 @@ class OSUtilsTesting(unittest.TestCase): None) self.assertTrue(mock_logger_error.called) - def test_list_volume_types_default_private(self): - self.assertEqual(openstack_utils. - list_volume_types(self.cinder_client, - public=False, - private=True), - [self.volume_types[1]]) - - def test_list_volume_types_default_public(self): - self.assertEqual(openstack_utils. - list_volume_types(self.cinder_client, - public=True, - private=False), - [self.volume_types[0]]) - - @mock.patch('functest.utils.openstack_utils.logger.error') - def test_list_volume_types_exception(self, mock_logger_error): - self.assertEqual(openstack_utils. - list_volume_types(Exception), - None) - self.assertTrue(mock_logger_error.called) - - def test_create_volume_type_default(self): - self.assertEqual(openstack_utils. - create_volume_type(self.cinder_client, - 'test_volume_type'), - self.volume_types[0]) - - @mock.patch('functest.utils.openstack_utils.logger.error') - def test_create_volume_type_exception(self, mock_logger_error): - self.assertEqual(openstack_utils. - create_volume_type(Exception, - 'test_volume_type'), - None) - self.assertTrue(mock_logger_error.called) - def test_update_cinder_quota_default(self): self.assertTrue(openstack_utils. update_cinder_quota(self.cinder_client, @@ -1597,18 +1545,6 @@ class OSUtilsTesting(unittest.TestCase): forced=True)) self.assertTrue(mock_logger_error.called) - def test_delete_volume_type_default(self): - self.assertTrue(openstack_utils. - delete_volume_type(self.cinder_client, - self.volume_types[0])) - - @mock.patch('functest.utils.openstack_utils.logger.error') - def test_delete_volume_type_exception(self, mock_logger_error): - self.assertFalse(openstack_utils. - delete_volume_type(Exception, - self.volume_types[0])) - self.assertTrue(mock_logger_error.called) - def test_get_tenants_default(self): with mock.patch('functest.utils.openstack_utils.' 'is_keystone_v3', return_value=True): -- cgit 1.2.3-korg