def getSummary(self): ''' Gets a summary of test results. ''' runTime = self._counters[_STOP_STAMP] - self._counters[_START_STAMP] summary = { COUNTER_RUN_TIME: utils.runTimeToString(runTime), COUNTER_N_TESTS: self._counters[COUNTER_N_TESTS], COUNTER_TESTS_RUN: self._counters[COUNTER_TESTS_RUN], COUNTER_CORE_DUMPS: self._counters[COUNTER_CORE_DUMPS] } # Copy all status counters except STATUS_NO_RUN for status in STATUS_COUNTERS[1:]: summary[status] = self._counters[status] return summary
def testRunTimeToStringMoreThan24h(self): seconds = 398770.412366 self.assertEqual("110h 46m 10.41s", runTimeToString(seconds))
def testRunTimeToStringSecondsOnly(self): seconds = 46.99982 self.assertEqual("47.00s", runTimeToString(seconds))
def testRunTimeToStringNoHours(self): seconds = 1444.37982 self.assertEqual("24m 4.38s", runTimeToString(seconds))
def testRunTimeToString(self): seconds = 8642.10982 self.assertEqual("2h 24m 2.11s", runTimeToString(seconds))