Merge "Conform ODL with last framework updates"
authorMorgan Richomme <morgan.richomme@orange.com>
Wed, 10 May 2017 07:54:08 +0000 (07:54 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Wed, 10 May 2017 07:54:08 +0000 (07:54 +0000)
1  2 
functest/core/testcase.py

@@@ -39,25 -39,10 +39,25 @@@ 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 __str__(self):
 +        try:
 +            assert self.project_name
 +            assert self.case_name
 +            result = 'PASS' if(self.is_successful(
 +                ) == TestCase.EX_OK) else 'FAIL'
 +            return ('| {0:<23} | {1:<13} | {2:<10} | {3:<13} |'
 +                    '\n{4:-<26}{4:-<16}{4:-<13}{4:-<16}{4}'.format(
 +                        self.case_name, self.project_name,
 +                        self.get_duration(), result, '+'))
 +        except AssertionError:
 +            self.__logger.error("We cannot print invalid objects")
 +            return '| {0:^68} |\n{1:-<26}{1:-<16}{1:-<13}{1:-<16}{1}'.format(
 +                'INVALID OBJECT', '+')
 +
      def get_duration(self):
          """Return the duration of the test case.