diff options
author | Cedric Ollivier <cedric.ollivier@orange.com> | 2018-02-09 15:34:36 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-02-09 15:34:36 +0000 |
commit | 5aa9bd71ba9f2e135fcb7ad05952487dc6a74eb2 (patch) | |
tree | 14c680eef31ce6c6eebb668de982296845beb9fe /functest/tests/unit/utils | |
parent | 8977b074eff97ce8bab359fd4cffed2b6d342b4e (diff) | |
parent | 746c1eb8b66ef38d3b21db2010cc820cb92c0293 (diff) |
Merge "Move get_dict_by_test() into run_tests.py"
Diffstat (limited to 'functest/tests/unit/utils')
-rw-r--r-- | functest/tests/unit/utils/test_functest_utils.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py index 218d03c4..dd34c90d 100644 --- a/functest/tests/unit/utils/test_functest_utils.py +++ b/functest/tests/unit/utils/test_functest_utils.py @@ -55,8 +55,6 @@ class FunctestUtilsTesting(unittest.TestCase): self.cmd = 'test_cmd' self.output_file = 'test_output_file' self.testname = 'testname' - self.testcase_dict = {'case_name': 'testname', - 'criteria': self.criteria} self.parameter = 'general.openstack.image_name' self.config_yaml = pkg_resources.resource_filename( 'functest', 'ci/config_functest.yaml') @@ -255,32 +253,6 @@ class FunctestUtilsTesting(unittest.TestCase): def _get_functest_config(self, var): return var - @mock.patch('functest.utils.functest_utils.LOGGER.error') - def test_get_dict_by_test(self, mock_logger_error): - with mock.patch('six.moves.builtins.open', mock.mock_open()), \ - mock.patch('functest.utils.functest_utils.yaml.safe_load') \ - as mock_yaml: - mock_obj = mock.Mock() - attrs = {'get.return_value': [{'testcases': [self.testcase_dict]}]} - mock_obj.configure_mock(**attrs) - - mock_yaml.return_value = mock_obj - - self.assertDictEqual(functest_utils. - get_dict_by_test(self.testname), - self.testcase_dict) - - @mock.patch('functest.utils.functest_utils.get_dict_by_test') - def test_get_criteria_by_test_default(self, mock_get_dict_by_test): - mock_get_dict_by_test.return_value = self.testcase_dict - self.assertEqual(functest_utils.get_criteria_by_test(self.testname), - self.criteria) - - @mock.patch('functest.utils.functest_utils.get_dict_by_test') - def test_get_criteria_by_test_failed(self, mock_get_dict_by_test): - mock_get_dict_by_test.return_value = None - self.assertIsNone(functest_utils.get_criteria_by_test(self.testname)) - def test_get_parameter_from_yaml_failed(self): self.file_yaml['general'] = None with mock.patch('six.moves.builtins.open', mock.mock_open()), \ |