Chromium Code Reviews| 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('', [], [], None, None) | |
| 13 self.assertEqual(culprit.fields, ('project', 'components', 'cls', | |
|
wrengr
2016/10/31 23:48:35
N.B., this is fragile. In general Culprit is not d
Sharu Jiang
2016/11/01 23:54:09
Actually we can still get suspected_project and su
wrengr
2016/11/03 16:14:33
No, FindCulprit should return None (or rather: not
| |
| 14 'regression_range', 'algorithm')) | |
| 15 def testToDicts(self): | |
| 16 culprit = Culprit(None, None, None, None, None) | |
|
wrengr
2016/10/31 23:48:35
Again, this is fragile. Culprit expects all the fi
Sharu Jiang
2016/11/01 23:54:09
Still, it's possible that some of those fields are
wrengr
2016/11/03 16:14:33
No, again. The Culprit class is defined to encapsu
| |
| 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': None})) | |
| 24 | |
| 25 cl = self.GetDummyChangeLog() | |
|
wrengr
2016/10/31 23:48:35
Below from here should be broken out into a separa
| |
| 26 culprit = Culprit('proj', ['comp'], [cl], ['50.0.1234.1', '50.0.1234.2'], | |
| 27 'core_algorithm') | |
| 28 self.assertTupleEqual(culprit.ToDicts(), | |
| 29 ({'found': True, | |
| 30 'regression_range': ['50.0.1234.1', '50.0.1234.2'], | |
| 31 'suspected_project': 'proj', | |
| 32 'suspected_components': ['comp'], | |
| 33 'suspected_cls': [cl.ToDict()]}, | |
| 34 {'found_suspects': True, | |
| 35 'found_project': True, | |
| 36 'found_components': True, | |
| 37 'has_regression_range': True, | |
| 38 'solution': 'core_algorithm'})) | |
| OLD | NEW |