| 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'}))
|
|
|