| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 from crash.culprit import Culprit |
| 6 from crash.test.crash_testcase import CrashTestCase |
| 7 |
| 8 |
| 9 class CulpritTest(CrashTestCase): |
| 10 |
| 11 def testFieldsProperty(self): |
| 12 culprit = Culprit('', ['Blink>DOM'], [], None, 'core_algorithm') |
| 13 self.assertEqual(culprit.fields, ('project', 'components', 'cls', |
| 14 'regression_range', 'algorithm')) |
| 15 def testToDictsDroppingEmptyFields(self): |
| 16 culprit = Culprit('', [], [], [], 'core_algorithm') |
| 17 self.assertTupleEqual(culprit.ToDicts(), |
| 18 ({'found': False}, |
| 19 {'found_suspects': False, |
| 20 'found_project': False, |
| 21 'found_components': False, |
| 22 'has_regression_range': False, |
| 23 'solution': 'core_algorithm'})) |
| 24 |
| 25 def testToDicts(self): |
| 26 cl = self.GetDummyChangeLog() |
| 27 culprit = Culprit('proj', ['comp'], [cl], ['50.0.1234.1', '50.0.1234.2'], |
| 28 'core_algorithm') |
| 29 self.assertTupleEqual(culprit.ToDicts(), |
| 30 ({'found': True, |
| 31 'regression_range': ['50.0.1234.1', '50.0.1234.2'], |
| 32 'suspected_project': 'proj', |
| 33 'suspected_components': ['comp'], |
| 34 'suspected_cls': [cl.ToDict()]}, |
| 35 {'found_suspects': True, |
| 36 'found_project': True, |
| 37 'found_components': True, |
| 38 'has_regression_range': True, |
| 39 'solution': 'core_algorithm'})) |
| OLD | NEW |