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

Unified Diff: appengine/findit/crash/loglinear/changelist_features/test/touch_crashed_file_test.py

Issue 2704843002: [Predator] Add TouchCrashedDirectory feature. (Closed)
Patch Set: . Created 3 years, 10 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/changelist_features/test/touch_crashed_file_test.py
diff --git a/appengine/findit/crash/loglinear/changelist_features/test/touch_crashed_file_test.py b/appengine/findit/crash/loglinear/changelist_features/test/touch_crashed_file_test.py
index 77099b2baeeeb991fa5495b28f06dbe989b84504..b236af777295df45acc252c5ff3ffa429389e1d5 100644
--- a/appengine/findit/crash/loglinear/changelist_features/test/touch_crashed_file_test.py
+++ b/appengine/findit/crash/loglinear/changelist_features/test/touch_crashed_file_test.py
@@ -4,10 +4,13 @@
import unittest
+from crash.crash_match import CrashMatch
+from crash.crash_match import FrameInfo
from crash.loglinear.changelist_features.touch_crashed_file import (
TouchCrashedFileFeature)
+from crash.loglinear.changelist_features.touch_crashed_file_meta import (
+ CrashedFile)
from crash.stacktrace import StackFrame
-from crash.stacktrace import StackInfo
from crash.suspect import Suspect
from libs.gitiles.change_log import ChangeLog
from libs.gitiles.change_log import FileChangeInfo
@@ -67,16 +70,17 @@ class TouchCrashedFileFeatureTest(unittest.TestCase):
"""Test that the feature returns log(1) when there is matched file."""
report = self._GetDummyReport()
suspect = self._GetMockSuspect()
- touched_file_to_stack_infos = {
- FileChangeInfo(ChangeType.MODIFY, 'a.cc', 'a.cc'):
- [StackInfo(frame=StackFrame(index=0,
- dep_path=suspect.dep_path,
- function='func',
- file_path='a.cc',
- raw_file_path='a.cc',
- crashed_line_numbers=[7]),
- priority = 0)]
- }
+ frame = StackFrame(index=0,
+ dep_path=suspect.dep_path,
+ function='func',
+ file_path='a.cc',
+ raw_file_path='a.cc',
+ crashed_line_numbers=[7])
+
+ crashed = CrashedFile(frame)
+ matches = {crashed:
+ CrashMatch(crashed,
+ [FileChangeInfo(ChangeType.MODIFY, 'a.cc', 'a.cc')],
+ [FrameInfo(frame=frame, priority = 0)])}
self.assertEqual(lmath.LOG_ONE,
- TouchCrashedFileFeature()(report)(
- suspect, touched_file_to_stack_infos).value)
+ TouchCrashedFileFeature()(report)(suspect, matches).value)

Powered by Google App Engine
This is Rietveld 408576698