aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/ci/test_run_tests.py
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2017-05-03 14:11:38 +0200
committerJose Lausuch <jose.lausuch@ericsson.com>2017-05-05 12:50:46 +0000
commitf5c2aaa5ea6dce72fda01a3392d88148264eb02b (patch)
treeb84fa1e753749b28f5259e94e67d22e75fde5a20 /functest/tests/unit/ci/test_run_tests.py
parenta92a31aac7656e8beaeed49eae5f1e4af2f46e86 (diff)
Replace CONST.* by getattribute/setattr
Directories affected: - ci - core and respective unit tests Change-Id: I6a3d5aa68de29fc5a37ae543a067ff797eba33e6 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'functest/tests/unit/ci/test_run_tests.py')
-rw-r--r--functest/tests/unit/ci/test_run_tests.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/functest/tests/unit/ci/test_run_tests.py b/functest/tests/unit/ci/test_run_tests.py
index 7d02b1af1..ef08282aa 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)