Ejemplo n.º 1
0
 def testCrashAnalysisReset(self):
     analysis = CrashAnalysis()
     analysis.pipeline_status_path = ''
     analysis.status = analysis_status.COMPLETED
     analysis.requested_time = datetime.utcnow()
     analysis.started_time = datetime.utcnow()
     analysis.predator_version = ''
     analysis.has_regression_range = True
     analysis.found_suspects = True
     analysis.solution = ''
     analysis.Reset()
     self.assertIsNone(analysis.pipeline_status_path)
     self.assertEqual(analysis_status.PENDING, analysis.status)
     self.assertIsNone(analysis.started_time)
     self.assertIsNone(analysis.predator_version)
     self.assertIsNone(analysis.has_regression_range)
     self.assertIsNone(analysis.found_suspects)
     self.assertIsNone(analysis.solution)
     self.assertEqual(analysis.result, None)
     self.assertEqual(analysis.regression_range_triage_status,
                      triage_status.UNTRIAGED)
     self.assertEqual(analysis.suspected_cls_triage_status,
                      triage_status.UNTRIAGED)
     self.assertEqual(analysis.suspected_project_triage_status,
                      triage_status.UNTRIAGED)
     self.assertEqual(analysis.suspected_components_triage_status,
                      triage_status.UNTRIAGED)
Ejemplo n.º 2
0
 def testCrashAnalysisDurationWhenStartTimeNotSet(self):
     analysis = CrashAnalysis()
     analysis.status = analysis_status.COMPLETED
     analysis.started_time = datetime(2015, 07, 30, 21, 15, 30, 40)
     analysis.completed_time = datetime(2015, 07, 30, 21, 16, 15, 50)
     self.assertEqual(45, analysis.duration)