From 2030e14451a072844e750318de0d5efc47d4500c Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sun, 21 Jan 2018 01:02:20 +0100 Subject: Fully test and cover functest/ci/tier_* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It also fixes check_deployment.py and ci unit tests which were wrong when testing exceptions. Now ci modules are rated 10/10 and fully covered. Change-Id: I30dca491b44cc54aa1abc0d0433c00b4dcabfdc4 Signed-off-by: Cédric Ollivier --- functest/tests/unit/ci/test_run_tests.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 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 93cbfccdf..0db5f2832 100644 --- a/functest/tests/unit/ci/test_run_tests.py +++ b/functest/tests/unit/ci/test_run_tests.py @@ -20,12 +20,6 @@ class FakeModule(TestCase): def run(self): return TestCase.EX_OK - def push_to_db(self): - return TestCase.EX_OK - - def is_successful(self): - return TestCase.EX_OK - class RunTestsTesting(unittest.TestCase): @@ -121,9 +115,9 @@ class RunTestsTesting(unittest.TestCase): mock.patch('functest.ci.run_tests.Runner.get_run_dict', return_value=None), \ self.assertRaises(Exception) as context: - self.runner(mock_test, 'tier_name') - msg = "Cannot import the class for the test case." - self.assertTrue(msg in context) + self.runner.run_test(mock_test) + msg = "Cannot import the class for the test case." + self.assertTrue(msg in str(context.exception)) @mock.patch('functest.ci.run_tests.Runner.source_rc_file') @mock.patch('importlib.import_module', name="module", -- cgit 1.2.3-korg