aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/utils
diff options
context:
space:
mode:
authorLinda Wang <wangwulin@huawei.com>2017-08-28 08:22:32 +0000
committerLinda Wang <wangwulin@huawei.com>2017-08-28 08:22:32 +0000
commit9cd065bd3ce2544ced1ace605da0d77c1b59cb3b (patch)
treeb737b86c5a794d8a84b7eec113ed9af0f5b97d5f /functest/tests/unit/utils
parent78be021d910088aeced1b62c9d00dffa33f74ca3 (diff)
Obtain scenario by CONST instead of get function
JIRA: FUNCTEST-763 Change-Id: Ic9fa3243b50a09de8a5e531fed8298997367dd84 Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'functest/tests/unit/utils')
-rw-r--r--functest/tests/unit/utils/test_functest_utils.py26
1 files changed, 3 insertions, 23 deletions
diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py
index cd3693c7..d67f4135 100644
--- a/functest/tests/unit/utils/test_functest_utils.py
+++ b/functest/tests/unit/utils/test_functest_utils.py
@@ -114,25 +114,6 @@ class FunctestUtilsTesting(unittest.TestCase):
self.assertEqual(functest_utils.get_installer_type(),
self.installer)
- @mock.patch('functest.utils.functest_utils.logger.info')
- def test_get_scenario_failed(self, mock_logger_info):
- with mock.patch.dict(os.environ,
- {},
- clear=True):
- self.assertEqual(functest_utils.get_scenario(),
- "os-nosdn-nofeature-noha")
- mock_logger_info.assert_called_once_with("Impossible to retrieve "
- "the scenario.Use "
- "default "
- "os-nosdn-nofeature-noha")
-
- def test_get_scenario_default(self):
- with mock.patch.dict(os.environ,
- {'DEPLOY_SCENARIO': 'test_scenario'},
- clear=True):
- self.assertEqual(functest_utils.get_scenario(),
- self.scenario)
-
def test_get_version_daily_job(self):
CONST.__setattr__('BUILD_TAG', self.build_tag)
self.assertEqual(functest_utils.get_version(), self.version)
@@ -154,10 +135,9 @@ class FunctestUtilsTesting(unittest.TestCase):
CONST.__setattr__('results_test_db_url', self.db_url)
CONST.__setattr__('BUILD_TAG', self.build_tag)
CONST.__setattr__('NODE_NAME', self.node_name)
- with mock.patch('functest.utils.functest_utils.get_scenario',
- return_value=self.scenario), \
- mock.patch('functest.utils.functest_utils.get_version',
- return_value=self.version):
+ CONST.__setattr__('DEPLOY_SCENARIO', self.scenario)
+ with mock.patch('functest.utils.functest_utils.get_version',
+ return_value=self.version):
functest_utils.logger_test_results(self.project, self.case_name,
self.status, self.details)
mock_logger_info.assert_called_once_with(