aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/ci/test_run_tests.py
diff options
context:
space:
mode:
authorJose Lausuch <jose.lausuch@ericsson.com>2017-05-05 13:50:54 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-05-05 13:50:54 +0000
commit6e4d097a8881fa0cfcc2c192639eb0f17ce025a2 (patch)
treeb8a658487f2399f201426d25adaa3b51f627393b /functest/tests/unit/ci/test_run_tests.py
parent60f2c04e6c01c55cb66dfaebda436e2c60a6a3ac (diff)
parentf5c2aaa5ea6dce72fda01a3392d88148264eb02b (diff)
Merge "Replace CONST.* by getattribute/setattr"
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 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)