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

Unified Diff: appengine/findit/crash/test/culprit_test.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
Index: appengine/findit/crash/test/culprit_test.py
diff --git a/appengine/findit/crash/test/culprit_test.py b/appengine/findit/crash/test/culprit_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..d1b3da4f6ab1b6302f7a1769cf1446e87b361e9e
--- /dev/null
+++ b/appengine/findit/crash/test/culprit_test.py
@@ -0,0 +1,39 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from crash.culprit import Culprit
+from crash.test.crash_testcase import CrashTestCase
+
+
+class CulpritTest(CrashTestCase):
+
+ def testFieldsProperty(self):
+ culprit = Culprit('', ['Blink>DOM'], [], None, 'core_algorithm')
+ self.assertEqual(culprit.fields, ('project', 'components', 'cls',
+ 'regression_range', 'algorithm'))
+ def testToDictsDroppingEmptyFields(self):
+ culprit = Culprit('', [], [], [], 'core_algorithm')
+ self.assertTupleEqual(culprit.ToDicts(),
+ ({'found': False},
+ {'found_suspects': False,
+ 'found_project': False,
+ 'found_components': False,
+ 'has_regression_range': False,
+ 'solution': 'core_algorithm'}))
+
+ def testToDicts(self):
+ cl = self.GetDummyChangeLog()
+ culprit = Culprit('proj', ['comp'], [cl], ['50.0.1234.1', '50.0.1234.2'],
+ 'core_algorithm')
+ self.assertTupleEqual(culprit.ToDicts(),
+ ({'found': True,
+ 'regression_range': ['50.0.1234.1', '50.0.1234.2'],
+ 'suspected_project': 'proj',
+ 'suspected_components': ['comp'],
+ 'suspected_cls': [cl.ToDict()]},
+ {'found_suspects': True,
+ 'found_project': True,
+ 'found_components': True,
+ 'has_regression_range': True,
+ 'solution': 'core_algorithm'}))
« no previous file with comments | « appengine/findit/crash/test/changelist_classifier_test.py ('k') | appengine/findit/crash/test/findit_for_chromecrash_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698