def test_Uptime(self): runtime_info = self._Test__new() # whats the uptime we expect? start_time = applicationController.getStartTime() asserted_uptime = time.time() - start_time # get the uptime the current implementation calculates test_uptime = runtime_info.getUptime() self.failUnless(abs(asserted_uptime - test_uptime) < time_tolerance)
def started(self): stamp = applicationController.getStartTime() try: stamp = datetime.fromtimestamp(stamp) except (ValueError, TypeError), err: return stamp