Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: appengine/findit/handlers/crash/test/crash_handler_test.py

Issue 2432203003: [Predator] Run predator. (Closed)
Patch Set: Fix nits. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import base64 5 import base64
6 import copy 6 import copy
7 import json 7 import json
8 import logging 8 import logging
9 9
10 from google.appengine.api import app_identity 10 from google.appengine.api import app_identity
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 # TODO(wrengr): should we clone ``crash_data`` rather than mutating it? 85 # TODO(wrengr): should we clone ``crash_data`` rather than mutating it?
86 crash_data['platform'] = self.RenamePlatform(crash_data['platform']) 86 crash_data['platform'] = self.RenamePlatform(crash_data['platform'])
87 return crash_data 87 return crash_data
88 88
89 def _NeedsNewAnalysis(self, new_crash_data): 89 def _NeedsNewAnalysis(self, new_crash_data):
90 logging.debug('Called _MockFindit._NeedsNewAnalysis, as desired') 90 logging.debug('Called _MockFindit._NeedsNewAnalysis, as desired')
91 testcase.assertDictEqual(new_crash_data, renamed_crash_data) 91 testcase.assertDictEqual(new_crash_data, renamed_crash_data)
92 return False 92 return False
93 93
94 self.mock(crash_pipeline, 'FinditForClientID', 94 self.mock(crash_pipeline, 'FinditForClientID',
95 lambda _client_id: _MockFindit()) 95 lambda _client_id, repository: _MockFindit())
96 self.assertFalse(crash_handler.ScheduleNewAnalysis(original_crash_data)) 96 self.assertFalse(crash_handler.ScheduleNewAnalysis(original_crash_data))
97 97
98 def testScheduleNewAnalysisSkipsUnsupportedChannel(self): 98 def testScheduleNewAnalysisSkipsUnsupportedChannel(self):
99 self.assertFalse(crash_handler.ScheduleNewAnalysis(DummyCrashData( 99 self.assertFalse(crash_handler.ScheduleNewAnalysis(DummyCrashData(
100 client_id = CrashClient.FRACAS, 100 client_id = CrashClient.FRACAS,
101 version = None, 101 version = None,
102 signature = None, 102 signature = None,
103 crash_identifiers = {}, 103 crash_identifiers = {},
104 channel = 'unsupported_channel'))) 104 channel = 'unsupported_channel')))
105 105
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 'has_regression_range': True, 339 'has_regression_range': True,
340 'solution': 'core', 340 'solution': 'core',
341 'unsupported_tag': '', 341 'unsupported_tag': '',
342 } 342 }
343 343
344 analysis = self._TestRunningAnalysisForResult( 344 analysis = self._TestRunningAnalysisForResult(
345 analysis_result, analysis_tags) 345 analysis_result, analysis_tags)
346 self.assertTrue(analysis.has_regression_range) 346 self.assertTrue(analysis.has_regression_range)
347 self.assertTrue(analysis.found_suspects) 347 self.assertTrue(analysis.found_suspects)
348 self.assertEqual('core', analysis.solution) 348 self.assertEqual('core', analysis.solution)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698