aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-05-05 15:24:54 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-05-05 16:19:55 +0200
commit537b2d246673e47667866636de736a7d9bfb9884 (patch)
tree4ad8f34488f5989cee5f0c14cd99f0bf714f3d72
parentee26a1ca85fc5fac6df6c39f362fad83de73c0cc (diff)
Rename TestCase check_result() to is_successful()
Change-Id: I41cea33b4c1dae79e75231e7c7e069fc89736f34 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r--functest/core/testcase.py4
-rw-r--r--functest/tests/unit/core/test_testcase.py16
2 files changed, 10 insertions, 10 deletions
diff --git a/functest/core/testcase.py b/functest/core/testcase.py
index fd8928494..624655424 100644
--- a/functest/core/testcase.py
+++ b/functest/core/testcase.py
@@ -61,7 +61,7 @@ class TestCase(object):
self.__logger.error("Please run test before getting the duration")
return "XX:XX"
- def check_result(self):
+ def is_successful(self):
"""Interpret the result of the test case.
It allows getting the result of TestCase. It completes run()
@@ -141,7 +141,7 @@ class TestCase(object):
assert self.case_name
assert self.start_time
assert self.stop_time
- pub_result = 'PASS' if self.check_result(
+ pub_result = 'PASS' if self.is_successful(
) == TestCase.EX_OK else 'FAIL'
if ft_utils.push_results_to_db(
self.project_name, self.case_name, self.start_time,
diff --git a/functest/tests/unit/core/test_testcase.py b/functest/tests/unit/core/test_testcase.py
index 37948ee18..17329ea32 100644
--- a/functest/tests/unit/core/test_testcase.py
+++ b/functest/tests/unit/core/test_testcase.py
@@ -116,12 +116,12 @@ class TestCaseTesting(unittest.TestCase):
def test_check_criteria_missing(self):
self.test.criteria = None
- self.assertEqual(self.test.check_result(),
+ self.assertEqual(self.test.is_successful(),
testcase.TestCase.EX_TESTCASE_FAILED)
def test_check_result_missing(self):
self.test.result = None
- self.assertEqual(self.test.check_result(),
+ self.assertEqual(self.test.is_successful(),
testcase.TestCase.EX_TESTCASE_FAILED)
def test_check_result_failed(self):
@@ -129,7 +129,7 @@ class TestCaseTesting(unittest.TestCase):
# It must be removed as soon as TestCase subclasses
# stop setting result = 'PASS' or 'FAIL'.
self.test.result = 'FAIL'
- self.assertEqual(self.test.check_result(),
+ self.assertEqual(self.test.is_successful(),
testcase.TestCase.EX_TESTCASE_FAILED)
def test_check_result_pass(self):
@@ -137,29 +137,29 @@ class TestCaseTesting(unittest.TestCase):
# It must be removed as soon as TestCase subclasses
# stop setting result = 'PASS' or 'FAIL'.
self.test.result = 'PASS'
- self.assertEqual(self.test.check_result(),
+ self.assertEqual(self.test.is_successful(),
testcase.TestCase.EX_OK)
def test_check_result_lt(self):
self.test.result = 50
- self.assertEqual(self.test.check_result(),
+ self.assertEqual(self.test.is_successful(),
testcase.TestCase.EX_TESTCASE_FAILED)
def test_check_result_eq(self):
self.test.result = 100
- self.assertEqual(self.test.check_result(),
+ self.assertEqual(self.test.is_successful(),
testcase.TestCase.EX_OK)
def test_check_result_gt(self):
self.test.criteria = 50
self.test.result = 100
- self.assertEqual(self.test.check_result(),
+ self.assertEqual(self.test.is_successful(),
testcase.TestCase.EX_OK)
def test_check_result_zero(self):
self.test.criteria = 0
self.test.result = 0
- self.assertEqual(self.test.check_result(),
+ self.assertEqual(self.test.is_successful(),
testcase.TestCase.EX_TESTCASE_FAILED)
def test_get_duration_start_ko(self):