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

Unified Diff: appengine/findit/crash/culprit.py

Issue 2449853012: [Predator] Fix bug in min_distance after refactor and add back skip added/deleted deps. (Closed)
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/crash/changelist_classifier.py ('k') | appengine/findit/crash/scorers/min_distance.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/crash/culprit.py
diff --git a/appengine/findit/crash/culprit.py b/appengine/findit/crash/culprit.py
index b57e0fd098e8a63ce6170315ea7da3cd68a94c6a..24765da57596c5d45174ba95038a2ebc47d8fdf3 100644
--- a/appengine/findit/crash/culprit.py
+++ b/appengine/findit/crash/culprit.py
@@ -4,14 +4,11 @@
from collections import namedtuple
-# TODO(http://crbug.com/659346): We do call this code from various
-# unittests, just not from culprit_test.py; so we need to add some extra
-# unittests there.
+
class Culprit(namedtuple('Culprit',
- ['project', 'components', 'cls', 'regression_range', 'algorithm']
- )): # pragma: no cover
+ ['project', 'components', 'cls', 'regression_range', 'algorithm'])):
"""The result of successfully identifying the culprit of a crash report.
-
+
Args:
project (str): the most-suspected project
components (list of str): the suspected crbug components.
@@ -101,12 +98,13 @@ class Culprit(namedtuple('Culprit',
bool(self.cls) or
bool(self.regression_range))
if self.regression_range:
+ assert isinstance(self.regression_range, list)
result['regression_range'] = self.regression_range
- if self.project is not None:
+ if self.project:
result['suspected_project'] = self.project
- if self.components is not None:
+ if self.components:
result['suspected_components'] = self.components
- if self.cls is not None:
+ if self.cls:
result['suspected_cls'] = [cl.ToDict() for cl in self.cls]
tags = {
« no previous file with comments | « appengine/findit/crash/changelist_classifier.py ('k') | appengine/findit/crash/scorers/min_distance.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698