From f2bbfb690ce435c389b548d6b299ff82f658ea80 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Tue, 9 May 2017 12:06:57 +0200 Subject: Conform ODL with last framework updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- functest/core/testcase.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'functest/core') diff --git a/functest/core/testcase.py b/functest/core/testcase.py index 62465542..b993183c 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: -- cgit 1.2.3-korg