diff options
author | 2018-03-14 14:53:23 +0000 | |
---|---|---|
committer | 2018-03-14 14:53:23 +0000 | |
commit | 370eee3b9b1b20057191aa614ddfda31f8656e8e (patch) | |
tree | 679010d4165d88bef2ca4cb9191a52d40d80e72f /functest/tests | |
parent | 3b5c3061ea9d03d124fa42d2e4f00cf26b06c535 (diff) | |
parent | cbcc92a846108386803d07fbb5d9c7838889090a (diff) |
Merge "Refactor TempestCommon to simplify subclasses"
Diffstat (limited to 'functest/tests')
-rw-r--r-- | functest/tests/unit/openstack/tempest/test_conf_utils.py | 10 | ||||
-rw-r--r-- | functest/tests/unit/openstack/tempest/test_tempest.py | 10 |
2 files changed, 5 insertions, 15 deletions
diff --git a/functest/tests/unit/openstack/tempest/test_conf_utils.py b/functest/tests/unit/openstack/tempest/test_conf_utils.py index 1c9a8aeee..fa53b57b1 100644 --- a/functest/tests/unit/openstack/tempest/test_conf_utils.py +++ b/functest/tests/unit/openstack/tempest/test_conf_utils.py @@ -233,16 +233,6 @@ class OSTempestConfUtilsTesting(unittest.TestCase): 'test_conf_file', res_dir='test_dir') self.assertTrue(mock_copyfile.called) - def test_conf_tempest_def(self): - with mock.patch('functest.opnfv_tests.openstack.tempest.' - 'conf_utils.configure_verifier', - return_value='test_conf_file'), \ - mock.patch('functest.opnfv_tests.openstack.tempest.' - 'conf_utils.configure_tempest_update_params')\ - as mock_upd: - conf_utils.configure_tempest('test_dep_dir', 'test_dir') - self.assertTrue(mock_upd.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.' diff --git a/functest/tests/unit/openstack/tempest/test_tempest.py b/functest/tests/unit/openstack/tempest/test_tempest.py index 52d98465d..436821143 100644 --- a/functest/tests/unit/openstack/tempest/test_tempest.py +++ b/functest/tests/unit/openstack/tempest/test_tempest.py @@ -59,7 +59,7 @@ class OSTempestTesting(unittest.TestCase): 'os.path.isfile', return_value=False), \ self.assertRaises(Exception) as context: msg = "Tempest test list file %s NOT found." - self.tempestcommon.generate_test_list('test_verifier_repo_dir') + self.tempestcommon.generate_test_list() self.assertTrue( (msg % conf_utils.TEMPEST_CUSTOM) in context.exception) @@ -69,7 +69,7 @@ class OSTempestTesting(unittest.TestCase): 'shutil.copyfile') as mock_copyfile, \ mock.patch('functest.opnfv_tests.openstack.tempest.tempest.' 'os.path.isfile', return_value=True): - self.tempestcommon.generate_test_list('test_verifier_repo_dir') + self.tempestcommon.generate_test_list() self.assertTrue(mock_copyfile.called) @mock.patch('functest.utils.functest_utils.execute_command') @@ -86,7 +86,7 @@ class OSTempestTesting(unittest.TestCase): "testr list-tests {1} > {2};" "cd -;".format(verifier_repo_dir, testr_mode, self.tempestcommon.list)) - self.tempestcommon.generate_test_list('test_verifier_repo_dir') + self.tempestcommon.generate_test_list() mock_exec.assert_called_once_with(cmd) def test_gen_tl_smoke_mode(self): @@ -210,7 +210,7 @@ class OSTempestTesting(unittest.TestCase): @mock.patch('functest.opnfv_tests.openstack.snaps.snaps_utils.' 'get_active_compute_cnt', return_value=2) @mock.patch('functest.opnfv_tests.openstack.tempest.tempest.' - 'conf_utils.configure_tempest', side_effect=Exception) + 'TempestCommon.configure', side_effect=Exception) def test_run_configure_tempest_ko(self, *args): # pylint: disable=unused-argument self.assertEqual(self.tempestcommon.run(), @@ -224,7 +224,7 @@ class OSTempestTesting(unittest.TestCase): @mock.patch('functest.opnfv_tests.openstack.snaps.snaps_utils.' 'get_active_compute_cnt', return_value=2) @mock.patch('functest.opnfv_tests.openstack.tempest.tempest.' - 'conf_utils.configure_tempest') + 'TempestCommon.configure') def _test_run(self, status, *args): # pylint: disable=unused-argument self.assertEqual(self.tempestcommon.run(), status) |