| Index: tools/auto_bisect/bisect_results_test.py
|
| diff --git a/tools/auto_bisect/bisect_results_test.py b/tools/auto_bisect/bisect_results_test.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..361f5f10d0e8b2a7902d0b0b9f44c1497c3ad1e0
|
| --- /dev/null
|
| +++ b/tools/auto_bisect/bisect_results_test.py
|
| @@ -0,0 +1,40 @@
|
| +# Copyright 2014 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.
|
| +
|
| +import unittest
|
| +
|
| +import bisect_results
|
| +import ttest
|
| +
|
| +
|
| +class ConfidenceScoreTest(unittest.TestCase):
|
| +
|
| + def testConfidenceScoreIsZeroOnTooFewLists(self):
|
| + self.assertEqual(bisect_results.ConfidenceScore([], [[1], [2]]), 0.0)
|
| + self.assertEqual(bisect_results.ConfidenceScore([[1], [2]], []), 0.0)
|
| + self.assertEqual(bisect_results.ConfidenceScore([[1]], [[1], [2]]), 0.0)
|
| + self.assertEqual(bisect_results.ConfidenceScore([[1], [2]], [[1]]), 0.0)
|
| +
|
| + def testConfidenceScoreIsZeroOnEmptyLists(self):
|
| + self.assertEqual(bisect_results.ConfidenceScore([[], []], [[1], [2]]), 0.0)
|
| + self.assertEqual(bisect_results.ConfidenceScore([[1], [2]], [[], []]), 0.0)
|
| +
|
| + def testConfidenceScoreIsUsingTTestWelchsTTest(self):
|
| + original_WelchsTTest = ttest.WelchsTTest
|
| + try:
|
| + ttest.WelchsTTest = lambda _sample1, _sample2: (0, 0, 0.42)
|
| + self.assertAlmostEqual(
|
| + bisect_results.ConfidenceScore([[1], [1]], [[2], [2]]), 58.0)
|
| + finally:
|
| + ttest.WelchsTTest = original_WelchsTTest
|
| +
|
| +
|
| +class BisectResulstsTest(unittest.TestCase):
|
| + # TODO(sergiyb): Write tests for GetResultDicts when it is broken into smaller
|
| + # pieces.
|
| + pass
|
| +
|
| +
|
| +if __name__ == '__main__':
|
| + unittest.main()
|
|
|