summaryrefslogtreecommitdiffstats
path: root/functest/core
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-05-09 12:06:57 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-05-09 13:42:21 +0200
commitf2bbfb690ce435c389b548d6b299ff82f658ea80 (patch)
tree19af76c5262ca9fc6fb2eadd858b90be3b879b36 /functest/core
parent1d5e199517ff09d959a1240f3b4e715be799058b (diff)
Conform ODL with last framework updates
Now ODL TestCase calculates the ratio between critical tests passed and failed and saves it in result. Non-critical test cases can fail as result doesn't take them into account [1]. It also updates default attribute values in TestCase and allows result to be float. [1] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#setting-criticality Change-Id: Id4a89271b5b1a90cd3c1e2b08591ff26ffaffee0 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/core')
-rw-r--r--functest/core/testcase.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/functest/core/testcase.py b/functest/core/testcase.py
index 624655424..b993183cc 100644
--- a/functest/core/testcase.py
+++ b/functest/core/testcase.py
@@ -39,9 +39,9 @@ class TestCase(object):
self.project_name = kwargs.get('project_name', 'functest')
self.case_name = kwargs.get('case_name', '')
self.criteria = kwargs.get('criteria', 100)
- self.result = ""
- self.start_time = ""
- self.stop_time = ""
+ self.result = 0
+ self.start_time = 0
+ self.stop_time = 0
def get_duration(self):
"""Return the duration of the test case.
@@ -75,7 +75,8 @@ class TestCase(object):
"""
try:
assert self.criteria
- if isinstance(self.result, int) and isinstance(self.criteria, int):
+ if (not isinstance(self.result, str) and
+ not isinstance(self.criteria, str)):
if self.result >= self.criteria:
return TestCase.EX_OK
else: