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

Unified Diff: appengine/findit/crash/scorers/test/aggregated_scorer_test.py

Issue 2588513002: [Predator] renamed "Result" to "Suspect" (Closed)
Patch Set: Removing redundant import 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 side-by-side diff with in-line comments
Download patch
Index: appengine/findit/crash/scorers/test/aggregated_scorer_test.py
diff --git a/appengine/findit/crash/scorers/test/aggregated_scorer_test.py b/appengine/findit/crash/scorers/test/aggregated_scorer_test.py
index 166d9398b1ebffd93d87e07b365fa392d6963333..48366ccd56a40fe53518d62898bf27d9839b90f1 100644
--- a/appengine/findit/crash/scorers/test/aggregated_scorer_test.py
+++ b/appengine/findit/crash/scorers/test/aggregated_scorer_test.py
@@ -3,9 +3,9 @@
# found in the LICENSE file.
from crash.stacktrace import StackFrame
-from crash.results import AnalysisInfo
-from crash.results import MatchResult
-from crash.results import StackInfo
+from crash.suspect import AnalysisInfo
+from crash.suspect import Suspect
+from crash.suspect import StackInfo
from crash.scorers import aggregators
from crash.scorers.aggregated_scorer import AggregatedScorer
from crash.scorers.min_distance import MinDistance
@@ -16,13 +16,13 @@ from crash.scorers.top_frame_index import TopFrameIndex
class AggregatedScorerTest(ScorerTestSuite):
def testScore(self):
- result = MatchResult(self._GetDummyChangeLog(), 'src/')
+ suspect = Suspect(self._GetDummyChangeLog(), 'src/')
frame = StackFrame(0, 'src/', 'func', 'a.cc', 'src/a.cc', [7],
repo_url='https://repo_url')
- result.file_to_stack_infos = {
+ suspect.file_to_stack_infos = {
'a.cc': [StackInfo(frame, 0)]
}
- result.file_to_analysis_info = {
+ suspect.file_to_analysis_info = {
'a.cc': AnalysisInfo(
min_distance=0,
min_distance_frame=frame
@@ -30,25 +30,25 @@ class AggregatedScorerTest(ScorerTestSuite):
}
aggregator = AggregatedScorer([TopFrameIndex(), MinDistance()])
- aggregator.Score(result)
+ aggregator.Score(suspect)
- self.assertEqual(result.confidence, 1)
- self.assertEqual(result.reasons,
+ self.assertEqual(suspect.confidence, 1)
+ self.assertEqual(suspect.reasons,
[('TopFrameIndex', 1.0, 'Top frame is #0'),
('MinDistance', 1, 'Minimum distance is 0')])
- self.assertEqual(result.changed_files,
+ self.assertEqual(suspect.changed_files,
[{'info': 'Minimum distance (LOC) 0, frame #0',
'blame_url': 'https://repo_url/+blame/1/a.cc#7',
'file': 'a.cc'}])
def testScoreWithCustomizedAggregators(self):
- result = MatchResult(self._GetDummyChangeLog(), 'src/')
+ suspect = Suspect(self._GetDummyChangeLog(), 'src/')
frame = StackFrame(0, 'src/', 'func', 'a.cc', 'src/a.cc', [7],
repo_url='https://repo_url')
- result.file_to_stack_infos = {
+ suspect.file_to_stack_infos = {
'a.cc': [(frame, 0)]
}
- result.file_to_analysis_info = {
+ suspect.file_to_analysis_info = {
'a.cc': AnalysisInfo(
min_distance=0,
min_distance_frame=frame
@@ -57,8 +57,8 @@ class AggregatedScorerTest(ScorerTestSuite):
aggregator = AggregatedScorer([TopFrameIndex(), MinDistance()])
aggregator.Score(
- result, score_aggregator=aggregators.IdentityAggregator(),
+ suspect, score_aggregator=aggregators.IdentityAggregator(),
reasons_aggregator=aggregators.IdentityAggregator(),
changed_files_aggregator=aggregators.ChangedFilesAggregator())
- self.assertEqual(result.confidence, [1, 1])
+ self.assertEqual(suspect.confidence, [1, 1])
« no previous file with comments | « appengine/findit/crash/scorers/min_distance.py ('k') | appengine/findit/crash/scorers/test/aggregators_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698