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 testCrashAnalysisStatusIsNotFailed(self):
     for status in (analysis_status.PENDING, analysis_status.RUNNING,
                    analysis_status.COMPLETED):
         analysis = CrashAnalysis()
         analysis.status = status
         self.assertFalse(analysis.failed)
Ejemplo n.º 3
0
 def testCrashAnalysisStatusIsFailed(self):
     analysis = CrashAnalysis()
     analysis.status = analysis_status.ERROR
     self.assertTrue(analysis.failed)
Ejemplo n.º 4
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)
Ejemplo n.º 5
0
 def testCrashAnalysisDurationWhenNotCompleted(self):
     analysis = CrashAnalysis()
     analysis.status = analysis_status.RUNNING
     self.assertIsNone(analysis.duration)
Ejemplo n.º 6
0
 def testCrashAnalysisStatusIsNotCompleted(self):
     for status in (analysis_status.PENDING, analysis_status.RUNNING):
         analysis = CrashAnalysis()
         analysis.status = status
         self.assertFalse(analysis.completed)
Ejemplo n.º 7
0
 def testCrashAnalysisStatusIsCompleted(self):
     for status in (analysis_status.COMPLETED, analysis_status.ERROR):
         analysis = CrashAnalysis()
         analysis.status = status
         self.assertTrue(analysis.completed)