Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: tools/auto_bisect/bisect_results_test.py

Issue 554283003: Refactored bisect results dicts into a separate class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adressed comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/auto_bisect/bisect_results.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 import unittest
6
7 import bisect_results
8 import ttest
9
10
11 class ConfidenceScoreTest(unittest.TestCase):
12
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)
18
19 def testConfidenceScoreIsZeroOnEmptyLists(self):
20 self.assertEqual(bisect_results.ConfidenceScore([[], []], [[1], [2]]), 0.0)
21 self.assertEqual(bisect_results.ConfidenceScore([[1], [2]], [[], []]), 0.0)
22
23 def testConfidenceScoreIsUsingTTestWelchsTTest(self):
24 original_WelchsTTest = ttest.WelchsTTest
25 try:
26 ttest.WelchsTTest = lambda _sample1, _sample2: (0, 0, 0.42)
27 self.assertAlmostEqual(
28 bisect_results.ConfidenceScore([[1], [1]], [[2], [2]]), 58.0)
29 finally:
30 ttest.WelchsTTest = original_WelchsTTest
31
32
33 class BisectResulstsTest(unittest.TestCase):
34 # TODO(sergiyb): Write tests for GetResultDicts when it is broken into smaller
35 # pieces.
36 pass
37
38
39 if __name__ == '__main__':
40 unittest.main()
OLDNEW
« no previous file with comments | « tools/auto_bisect/bisect_results.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698