Beispiel #1
0
 def testGetTriageHistoryWhenUserIsNotAdmin(self):
     analysis = WfAnalysis.Create('m', 'b', 1)
     analysis.status = analysis_status.COMPLETED
     analysis.triage_history = [{
         'triage_timestamp': 1438380761,
         'user_name': 'test',
         'result_status': 'dummy status',
         'version': 'dummy version',
     }]
     self.assertIsNone(build_failure._GetTriageHistory(analysis))
Beispiel #2
0
 def testGetTriageHistoryWhenUserIsAdmin(self):
     analysis = WfAnalysis.Create('m', 'b', 1)
     analysis.status = wf_analysis_status.ANALYZED
     analysis.triage_history = [{
         'triage_timestamp': 1438380761,
         'user_name': 'test',
         'result_status': 'dummy status',
         'version': 'dummy version',
     }]
     self.mock_current_user(user_email='*****@*****.**', is_admin=True)
     self.assertEqual(1, len(build_failure._GetTriageHistory(analysis)))
Beispiel #3
0
 def testGetTriageHistoryWhenUserIsNotAdmin(self):
   analysis = WfAnalysis.Create('m', 'b', 1)
   analysis.status = analysis_status.COMPLETED
   analysis.triage_history = [
       {
           'triage_timestamp': 1438380761,
           'user_name': 'test',
           'result_status': 'dummy status',
           'version': 'dummy version',
       }
   ]
   self.assertIsNone(build_failure._GetTriageHistory(analysis))
Beispiel #4
0
 def testGetTriageHistoryWhenUserIsAdmin(self):
   analysis = WfAnalysis.Create('m', 'b', 1)
   analysis.status = analysis_status.COMPLETED
   analysis.triage_history = [
       {
           'triage_timestamp': 1438380761,
           'user_name': 'test',
           'result_status': 'dummy status',
           'version': 'dummy version',
       }
   ]
   self.mock_current_user(user_email='*****@*****.**', is_admin=True)
   self.assertEqual(1, len(build_failure._GetTriageHistory(analysis)))
Beispiel #5
0
 def testGetTriageHistoryWhenUserIsAdmin(self):
     analysis = WfAnalysis.Create('m', 'b', 1)
     analysis.status = analysis_status.COMPLETED
     analysis.suspected_cls = [{
         'repo_name': 'chromium',
         'revision': 'rev1',
         'url': 'url',
         'commit_position': 123
     }]
     analysis.triage_history = [{
         'triage_timestamp': 1438380761,
         'user_name': 'test',
         'result_status': 'dummy status',
         'version': 'dummy version',
         'triaged_cl': 'chromium/rev1'
     }]
     self.mock_current_user(user_email='*****@*****.**', is_admin=True)
     self.assertEqual(1, len(build_failure._GetTriageHistory(analysis)))