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

Side by Side Diff: appengine/findit/crash/test/changelist_classifier_test.py

Issue 2590313002: Added Blame.AddReagions(iterable) method (Closed)
Patch Set: changing Blame.AddRegions to use list.extend Created 4 years 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
« no previous file with comments | « no previous file | appengine/findit/crash/test/suspect_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 from collections import defaultdict 5 from collections import defaultdict
6 import copy 6 import copy
7 7
8 from common.dependency import Dependency 8 from common.dependency import Dependency
9 from common.dependency import DependencyRoll 9 from common.dependency import DependencyRoll
10 from common import chrome_dependency_fetcher 10 from common import chrome_dependency_fetcher
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 1, 'src/', 'func', 'a.cc', 'src/a.cc', [7]), 0), 274 1, 'src/', 'func', 'a.cc', 'src/a.cc', [7]), 0),
275 ], 275 ],
276 'b.cc': [ 276 'b.cc': [
277 StackInfo(StackFrame( 277 StackInfo(StackFrame(
278 2, 'src/', 'func', 'b.cc', 'src/b.cc', [36]), 0), 278 2, 'src/', 'func', 'b.cc', 'src/b.cc', [36]), 0),
279 ] 279 ]
280 } 280 }
281 } 281 }
282 282
283 dummy_blame = Blame('9', 'a.cc') 283 dummy_blame = Blame('9', 'a.cc')
284 dummy_blame.AddRegion( 284 dummy_blame.AddRegions([
285 Region(1, 5, '6', 'a', 'a@chromium.org', 'Thu Mar 31 21:24:43 2016')) 285 Region(1, 5, '6', 'a', 'a@chromium.org', 'Thu Mar 31 21:24:43 2016'),
286 dummy_blame.AddRegion( 286 Region(6, 10, '1', 'b', 'b@chromium.org', 'Thu Jun 19 12:11:40 2015')])
287 Region(6, 10, '1', 'b', 'b@chromium.org', 'Thu Jun 19 12:11:40 2015'))
288 287
289 self.mock(GitilesRepository, 'GetBlame', lambda *_: dummy_blame) 288 self.mock(GitilesRepository, 'GetBlame', lambda *_: dummy_blame)
290 289
291 stack_deps = { 290 stack_deps = {
292 'src/': Dependency('src/', 'https://url_src', 'rev1', 'DEPS'), 291 'src/': Dependency('src/', 'https://url_src', 'rev1', 'DEPS'),
293 } 292 }
294 293
295 expected_suspects = [{ 294 expected_suspects = [{
296 'url': 'https://repo.test/+/1', 295 'url': 'https://repo.test/+/1',
297 'review_url': 'https://codereview.chromium.org/3281', 296 'review_url': 'https://codereview.chromium.org/3281',
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 return [suspect1, suspect2] 475 return [suspect1, suspect2]
477 476
478 self.mock(changelist_classifier, 'FindSuspects', _MockFindSuspects) 477 self.mock(changelist_classifier, 'FindSuspects', _MockFindSuspects)
479 self.mock(chrome_dependency_fetcher.ChromeDependencyFetcher, 478 self.mock(chrome_dependency_fetcher.ChromeDependencyFetcher,
480 'GetDependencyRollsDict', 479 'GetDependencyRollsDict',
481 lambda *_: {'src/': DependencyRoll('src/', 'https://repo', '1', '2')}) 480 lambda *_: {'src/': DependencyRoll('src/', 'https://repo', '1', '2')})
482 self.mock(chrome_dependency_fetcher.ChromeDependencyFetcher, 481 self.mock(chrome_dependency_fetcher.ChromeDependencyFetcher,
483 'GetDependency', lambda *_: {}) 482 'GetDependency', lambda *_: {})
484 483
485 self.assertListEqual(self.changelist_classifier(DUMMY_REPORT), []) 484 self.assertListEqual(self.changelist_classifier(DUMMY_REPORT), [])
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/crash/test/suspect_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698