Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import copy | 6 import copy |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 import unittest | 9 import unittest |
| 10 | 10 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 bisector.good_rev.values = [3, 3, 3, 3, 3, 3] | 142 bisector.good_rev.values = [3, 3, 3, 3, 3, 3] |
| 143 bisector.bad_rev.values = [3, 3, 3, 3] | 143 bisector.bad_rev.values = [3, 3, 3, 3] |
| 144 self.assertFalse(bisector.check_initial_confidence()) | 144 self.assertFalse(bisector.check_initial_confidence()) |
| 145 self.assertTrue(len(bisector.bad_rev.values) >= | 145 self.assertTrue(len(bisector.bad_rev.values) >= |
| 146 auto_bisect.bisector.MAX_REQUIRED_SAMPLES or | 146 auto_bisect.bisector.MAX_REQUIRED_SAMPLES or |
| 147 len(bisector.good_rev.values) >= | 147 len(bisector.good_rev.values) >= |
| 148 auto_bisect.bisector.MAX_REQUIRED_SAMPLES) | 148 auto_bisect.bisector.MAX_REQUIRED_SAMPLES) |
| 149 | 149 |
| 150 @mock.patch.object(auto_bisect.bisector.Bisector, 'significantly_different', | 150 @mock.patch.object(auto_bisect.bisector.Bisector, 'significantly_different', |
| 151 mock.MagicMock()) | 151 mock.MagicMock()) |
| 152 def test_check_initial_confidence_not_required(self): | 152 def test_check_initial_confidence_return_code(self): |
| 153 return_code_config = self.bisect_config | 153 return_code_config = self.bisect_config |
| 154 return_code_config['test_type'] = 'return_code' | 154 return_code_config['test_type'] = 'return_code' |
| 155 # When confidence is not required, confidence_score should not be called. | 155 # When confidence is not required, confidence_score should not be called. |
|
qyearsley
2016/03/23 20:54:40
This comment is now confusing since this test meth
RobertoCN
2016/03/23 21:52:09
Removed the check for not calling significantly di
| |
| 156 bisector = auto_bisect.bisector.Bisector(self.dummy_api, return_code_config, | 156 bisector = auto_bisect.bisector.Bisector(self.dummy_api, return_code_config, |
| 157 MockRevisionClass) | 157 MockRevisionClass) |
| 158 bisector.good_rev.mean_value = 0 | |
| 159 bisector.bad_rev.mean_value = 0 | |
| 160 self.assertFalse(bisector.check_initial_confidence()) | |
| 161 bisector.bad_rev.mean_value = 1 | |
| 158 self.assertTrue(bisector.check_initial_confidence()) | 162 self.assertTrue(bisector.check_initial_confidence()) |
| 159 self.assertFalse(bisector.significantly_different.called) | 163 self.assertFalse(bisector.significantly_different.called) |
| 160 | 164 |
|
qyearsley
2016/03/23 20:54:40
This test method might be a bit clearer if it's sp
RobertoCN
2016/03/23 21:52:09
Done.
| |
| 161 | 165 |
| 162 if __name__ == '__main__': | 166 if __name__ == '__main__': |
| 163 unittest.main() # pragma: no cover | 167 unittest.main() # pragma: no cover |
| OLD | NEW |