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

Unified Diff: appengine/findit/crash/loglinear/test/changelist_classifier_test.py

Issue 2617273002: [Predator] Move ``SingleFeatureScore`` to LLM. (Closed)
Patch Set: Address comment. Created 3 years, 11 months 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
Index: appengine/findit/crash/loglinear/test/changelist_classifier_test.py
diff --git a/appengine/findit/crash/loglinear/test/changelist_classifier_test.py b/appengine/findit/crash/loglinear/test/changelist_classifier_test.py
index 6b3db82e19280374a9cb9fa827dbaa48c17e3a39..7d1ff58f4fef81f9199ca5e8b60e7534a63df4aa 100644
--- a/appengine/findit/crash/loglinear/test/changelist_classifier_test.py
+++ b/appengine/findit/crash/loglinear/test/changelist_classifier_test.py
@@ -13,8 +13,6 @@ from common.chrome_dependency_fetcher import ChromeDependencyFetcher
import crash.changelist_classifier as scorer_changelist_classifier
from crash.crash_report import CrashReport
from crash.loglinear.changelist_classifier import LogLinearChangelistClassifier
-from crash.loglinear.feature import ChangedFile
-from crash.loglinear.feature import FeatureValue
from crash.suspect import AnalysisInfo
from crash.suspect import Suspect
from crash.suspect import StackInfo
@@ -130,40 +128,6 @@ class LogLinearChangelistClassifierTest(CrashTestSuite):
self.changelist_classifier = LogLinearChangelistClassifier(
GitilesRepository.Factory(self.GetMockHttpClient()), weights)
- def testAggregateChangedFilesAggregates(self):
- """Test that ``AggregateChangedFiles`` does aggregate reasons per file.
-
- In the main/inner loop of ``AggregateChangedFiles``: if multiple
- features all blame the same file change, we try to aggregate those
- reasons so that we only report the file once (with all reasons). None
- of the other tests here actually check the case where the same file
- is blamed multiple times, so we check that here.
-
- In particular, we provide the same ``FeatureValue`` twice, and
- hence the same ``ChangedFile`` twice; so we should get back a single
- ``ChangedFile`` but with the ``reasons`` fields concatenated.
- """
- file_reason = 'I blame you!'
- file_blame = ChangedFile(
- name = 'a.cc',
- blame_url = None,
- reasons = [file_reason]
- )
-
- feature_value = FeatureValue(
- name = 'dummy feature',
- value = 42,
- reason = 'dummy reason',
- changed_files = [file_blame]
- )
-
- expected_file_blame = file_blame._replace(reasons = [file_reason] * 2)
-
- self.assertListEqual(
- [expected_file_blame],
- self.changelist_classifier.AggregateChangedFiles(
- [feature_value] * 2))
-
# TODO(http://crbug.com/659346): why do these mocks give coverage
# failures? That's almost surely hiding a bug in the tests themselves.
def testFindItForCrashNoRegressionRange(self): # pragma: no cover

Powered by Google App Engine
This is Rietveld 408576698