From f5c2aaa5ea6dce72fda01a3392d88148264eb02b Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Wed, 3 May 2017 14:11:38 +0200 Subject: Replace CONST.* by getattribute/setattr Directories affected: - ci - core and respective unit tests Change-Id: I6a3d5aa68de29fc5a37ae543a067ff797eba33e6 Signed-off-by: jose.lausuch --- functest/tests/unit/ci/test_run_tests.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'functest/tests/unit/ci/test_run_tests.py') diff --git a/functest/tests/unit/ci/test_run_tests.py b/functest/tests/unit/ci/test_run_tests.py index 7d02b1af..ef08282a 100644 --- a/functest/tests/unit/ci/test_run_tests.py +++ b/functest/tests/unit/ci/test_run_tests.py @@ -62,13 +62,13 @@ class RunTestsTesting(unittest.TestCase): @mock.patch('functest.ci.run_tests.os_snapshot.main') def test_generate_os_snapshot(self, mock_os_snap): - run_tests.generate_os_snapshot() - self.assertTrue(mock_os_snap.called) + run_tests.generate_os_snapshot() + self.assertTrue(mock_os_snap.called) @mock.patch('functest.ci.run_tests.os_clean.main') def test_cleanup(self, mock_os_clean): - run_tests.cleanup() - self.assertTrue(mock_os_clean.called) + run_tests.cleanup() + self.assertTrue(mock_os_clean.called) def test_update_test_info(self): run_tests.GlobalVariables.EXECUTED_TEST_CASES = [self.test] @@ -179,7 +179,7 @@ class RunTestsTesting(unittest.TestCase): with mock.patch('functest.ci.run_tests.run_tier') as mock_method, \ mock.patch('functest.ci.run_tests.generate_report.init'), \ mock.patch('functest.ci.run_tests.generate_report.main'): - CONST.CI_LOOP = 'test_ci_loop' + CONST.__setattr__('CI_LOOP', 'test_ci_loop') run_tests.run_all(self.tiers) mock_method.assert_any_call(self.tier) self.assertTrue(mock_logger_info.called) @@ -188,7 +188,7 @@ class RunTestsTesting(unittest.TestCase): def test_run_all__missing_tier(self, mock_logger_info): with mock.patch('functest.ci.run_tests.generate_report.init'), \ mock.patch('functest.ci.run_tests.generate_report.main'): - CONST.CI_LOOP = 'loop_re_not_available' + CONST.__setattr__('CI_LOOP', 'loop_re_not_available') run_tests.run_all(self.tiers) self.assertTrue(mock_logger_info.called) @@ -268,5 +268,6 @@ class RunTestsTesting(unittest.TestCase): run_tests.Result.EX_ERROR) self.assertTrue(m.called) + if __name__ == "__main__": unittest.main(verbosity=2) -- cgit 1.2.3-korg