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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 self.assertEqual(1, len(results.warnings)) | 220 self.assertEqual(1, len(results.warnings)) |
221 | 221 |
222 def testWarningForTooLowRetryLimit(self): | 222 def testWarningForTooLowRetryLimit(self): |
223 self.mock_opts.repeat_test_count = 1 | 223 self.mock_opts.repeat_test_count = 1 |
224 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, | 224 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, |
225 self.mock_opts, self.mock_warnings) | 225 self.mock_opts, self.mock_warnings) |
226 self.assertEqual(1, len(results.warnings)) | 226 self.assertEqual(1, len(results.warnings)) |
227 | 227 |
228 def testWarningForTooLowConfidence(self): | 228 def testWarningForTooLowConfidence(self): |
229 revision_states = self.mock_bisect_state.mock_revision_states | 229 revision_states = self.mock_bisect_state.mock_revision_states |
230 revision_states[2].value = {'values': [95, 100, 90]} | 230 revision_states[2].value = {'values': [95, 90, 90]} |
RobertoCN
2015/01/14 18:50:47
Because of the new way of obtaining the confidence
RobertoCN
2015/01/30 21:23:32
Done.
| |
231 revision_states[3].value = {'values': [95, 100, 90]} | 231 revision_states[3].value = {'values': [95, 90, 90]} |
232 revision_states[4].value = {'values': [95, 100, 90]} | 232 revision_states[4].value = {'values': [95, 90, 90]} |
233 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, | 233 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, |
234 self.mock_opts, self.mock_warnings) | 234 self.mock_opts, self.mock_warnings) |
235 self.assertGreater(results.confidence, 0) | 235 self.assertGreater(results.confidence, 0) |
236 self.assertEqual(1, len(results.warnings)) | 236 self.assertEqual(1, len(results.warnings)) |
237 | 237 |
238 def testWarningForZeroConfidence(self): | 238 def testWarningForZeroConfidence(self): |
239 revision_states = self.mock_bisect_state.mock_revision_states | 239 revision_states = self.mock_bisect_state.mock_revision_states |
240 revision_states[2].value = {'values': [100, 105, 95]} | 240 revision_states[2].value = {'values': [100, 105, 95]} |
241 revision_states[3].value = {'values': [100, 105, 95]} | 241 revision_states[3].value = {'values': [100, 105, 95]} |
242 revision_states[4].value = {'values': [100, 105, 95]} | 242 revision_states[4].value = {'values': [100, 105, 95]} |
243 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, | 243 results = BisectResults(self.mock_bisect_state, self.mock_depot_registry, |
244 self.mock_opts, self.mock_warnings) | 244 self.mock_opts, self.mock_warnings) |
245 self.assertEqual(0, results.confidence) | 245 self.assertEqual(0, results.confidence) |
246 self.assertEqual(1, len(results.warnings)) | 246 self.assertEqual(1, len(results.warnings)) |
247 | 247 |
248 | 248 |
249 if __name__ == '__main__': | 249 if __name__ == '__main__': |
250 unittest.main() | 250 unittest.main() |
OLD | NEW |