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
3 # found in the LICENSE file.
11 class ConfidenceScoreTest(unittest.TestCase):
13 def testConfidenceScoreIsZeroOnTooFewLists(self):
14 self.assertEqual(bisect_results.ConfidenceScore([], [[1], [2]]), 0.0)
15 self.assertEqual(bisect_results.ConfidenceScore([[1], [2]], []), 0.0)
16 self.assertEqual(bisect_results.ConfidenceScore([[1]], [[1], [2]]), 0.0)
17 self.assertEqual(bisect_results.ConfidenceScore([[1], [2]], [[1]]), 0.0)
19 def testConfidenceScoreIsZeroOnEmptyLists(self):
20 self.assertEqual(bisect_results.ConfidenceScore([[], []], [[1], [2]]), 0.0)
21 self.assertEqual(bisect_results.ConfidenceScore([[1], [2]], [[], []]), 0.0)
23 def testConfidenceScoreIsUsingTTestWelchsTTest(self):
24 original_WelchsTTest = ttest.WelchsTTest
26 ttest.WelchsTTest = lambda _sample1, _sample2: (0, 0, 0.42)
27 self.assertAlmostEqual(
28 bisect_results.ConfidenceScore([[1], [1]], [[2], [2]]), 58.0)
30 ttest.WelchsTTest = original_WelchsTTest
33 class BisectResulstsTest(unittest.TestCase):
34 # TODO(sergiyb): Write tests for GetResultDicts when it is broken into smaller
39 if __name__ == '__main__':