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.