OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 import unittest | 6 import unittest |
7 | 7 |
8 from bisect_results import BisectResults | 8 from bisect_results import BisectResults |
9 import source_control | 9 import source_control |
10 | 10 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 self.assertAlmostEqual(99.9, results.confidence) | 228 self.assertAlmostEqual(99.9, results.confidence) |
229 self.assertAlmostEqual(1909.86547085, results.regression_size) | 229 self.assertAlmostEqual(1909.86547085, results.regression_size) |
230 self.assertAlmostEqual(7.16625904, results.regression_std_err) | 230 self.assertAlmostEqual(7.16625904, results.regression_std_err) |
231 | 231 |
232 def testFindsCulpritRevisions(self): | 232 def testFindsCulpritRevisions(self): |
233 revision_states = self.mock_bisect_state.mock_revision_states | 233 revision_states = self.mock_bisect_state.mock_revision_states |
234 revision_states[1].depot = 'chromium' | 234 revision_states[1].depot = 'chromium' |
235 revision_states[2].depot = 'webkit' | 235 revision_states[2].depot = 'webkit' |
236 | 236 |
237 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, | 237 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, |
238 self.mock_opts, self.mock_warnings) | 238 self.mock_opts, self.mock_warnings) |
239 | 239 |
240 self.assertEqual(1, len(results.culprit_revisions)) | 240 self.assertEqual(1, len(results.culprit_revisions)) |
241 self.assertEqual(('b', {'test': 'b'}, 'chromium'), | 241 self.assertEqual(('b', {'test': 'b'}, 'chromium'), |
242 results.culprit_revisions[0]) | 242 results.culprit_revisions[0]) |
243 | 243 |
244 def testFindsOtherRegressions(self): | 244 def testFindsOtherRegressions(self): |
245 revision_states = self.mock_bisect_state.mock_revision_states | 245 revision_states = self.mock_bisect_state.mock_revision_states |
246 revision_states[0].passed = 0 | 246 revision_states[0].passed = 0 |
247 revision_states[0].value = {'values': [100, 100, 100]} | 247 revision_states[0].value = {'values': [100, 100, 100]} |
248 revision_states[1].passed = 0 | 248 revision_states[1].passed = 0 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 revision_states[3].value = {'values': [100, 105, 95]} | 293 revision_states[3].value = {'values': [100, 105, 95]} |
294 revision_states[4].value = {'values': [100, 105, 95]} | 294 revision_states[4].value = {'values': [100, 105, 95]} |
295 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, | 295 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, |
296 self.mock_opts, self.mock_warnings) | 296 self.mock_opts, self.mock_warnings) |
297 self.assertEqual(0, results.confidence) | 297 self.assertEqual(0, results.confidence) |
298 self.assertEqual(1, len(results.warnings)) | 298 self.assertEqual(1, len(results.warnings)) |
299 | 299 |
300 | 300 |
301 if __name__ == '__main__': | 301 if __name__ == '__main__': |
302 unittest.main() | 302 unittest.main() |
OLD | NEW |