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

Unified 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, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/auto_bisect/bisect_results.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« 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