From c9fd7ceab29ff755aa8a9ee1bcb6ab958e5e0420 Mon Sep 17 00:00:00 2001 From: Linda Wang Date: Tue, 13 Mar 2018 01:36:40 +0000 Subject: Create 2 images and flavors for tempest tests Also 1. remove the obsolete function: generate_test_accounts_file 2. Use patch mechanism to get config Change-Id: I455ac37de71519bcaf9a51e5f1de1b9bc83b9ba6 Signed-off-by: Linda Wang --- functest/tests/unit/openstack/tempest/test_conf_utils.py | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'functest/tests/unit/openstack/tempest') diff --git a/functest/tests/unit/openstack/tempest/test_conf_utils.py b/functest/tests/unit/openstack/tempest/test_conf_utils.py index fa53b57b1..ee22f7fc3 100644 --- a/functest/tests/unit/openstack/tempest/test_conf_utils.py +++ b/functest/tests/unit/openstack/tempest/test_conf_utils.py @@ -76,19 +76,11 @@ class OSTempestConfUtilsTesting(unittest.TestCase): # pylint: disable=unused-argument tempest_resources = tempest.TempestResourcesManager( os_creds=self.os_creds) - - setattr(config.CONF, 'tempest_use_custom_flavors', 'True') with self.assertRaises(Exception) as context: tempest_resources.create() msg = 'Failed to create flavor' self.assertTrue(msg in context.exception, msg=str(context.exception)) - setattr(config.CONF, 'tempest_use_custom_flavors', 'False') - with self.assertRaises(Exception) as context: - tempest_resources.create(use_custom_flavors=True) - msg = 'Failed to create flavor' - self.assertTrue(msg in context.exception, msg=str(context.exception)) - @staticmethod @mock.patch('functest.opnfv_tests.openstack.tempest.conf_utils' '.LOGGER.info') @@ -233,13 +225,6 @@ class OSTempestConfUtilsTesting(unittest.TestCase): 'test_conf_file', res_dir='test_dir') self.assertTrue(mock_copyfile.called) - def test_gen_test_accounts_file_def(self): - with mock.patch("__builtin__.open", mock.mock_open()), \ - mock.patch('functest.opnfv_tests.openstack.tempest.conf_utils.' - 'yaml.dump') as mock_dump: - conf_utils.generate_test_accounts_file('test_tenant_id') - self.assertTrue(mock_dump.called) - def _test_missing_param(self, params, image_id, flavor_id): with mock.patch('functest.opnfv_tests.openstack.tempest.' 'conf_utils.ConfigParser.RawConfigParser.' -- cgit 1.2.3-korg