summaryrefslogtreecommitdiffstats
path: root/tools/auto_bisect/bisect_results_test.py
diff options
context:
space:
mode:
authorrobertocn <robertocn@chromium.org>2014-10-23 14:33:26 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-23 21:33:40 +0000
commitd0efba359b185fe140635b6269442a81e49e4c69 (patch)
tree94a44adf51aad9ae621068f25694ca7909ae81fb /tools/auto_bisect/bisect_results_test.py
parent63b390d81aa08c4c490522cc7aefbd282fb33bc7 (diff)
downloadchromium_src-d0efba359b185fe140635b6269442a81e49e4c69.zip
chromium_src-d0efba359b185fe140635b6269442a81e49e4c69.tar.gz
chromium_src-d0efba359b185fe140635b6269442a81e49e4c69.tar.bz2
Re-applying reverted changes plus fix. ConfidenceScore now takes flat
lists and the previously offending code now checks whether the lists need to be flattened before being passed to the function. BUG=422727 Review URL: https://codereview.chromium.org/644323002 Cr-Commit-Position: refs/heads/master@{#300196} Review URL: https://codereview.chromium.org/665893003 Cr-Commit-Position: refs/heads/master@{#300953}
Diffstat (limited to 'tools/auto_bisect/bisect_results_test.py')
-rw-r--r--tools/auto_bisect/bisect_results_test.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/tools/auto_bisect/bisect_results_test.py b/tools/auto_bisect/bisect_results_test.py
index 4b77806..25359c5 100644
--- a/tools/auto_bisect/bisect_results_test.py
+++ b/tools/auto_bisect/bisect_results_test.py
@@ -87,22 +87,14 @@ class BisectResultsTest(unittest.TestCase):
bad_values: First list of numbers.
good_values: Second list of numbers.
"""
- # ConfidenceScore takes a list of lists but these lists are flattened
- # inside the function.
- confidence = BisectResults.ConfidenceScore(
- [[v] for v in bad_values],
- [[v] for v in good_values])
+ confidence = BisectResults.ConfidenceScore(bad_values, good_values)
self.assertEqual(score, confidence)
def testConfidenceScoreIsZeroOnTooFewLists(self):
- self._AssertConfidence(0.0, [], [[1], [2]])
- self._AssertConfidence(0.0, [[1], [2]], [])
- self._AssertConfidence(0.0, [[1]], [[1], [2]])
- self._AssertConfidence(0.0, [[1], [2]], [[1]])
-
- def testConfidenceScoreIsZeroOnEmptyLists(self):
- self.assertEqual(BisectResults.ConfidenceScore([[], []], [[1], [2]]), 0.0)
- self.assertEqual(BisectResults.ConfidenceScore([[1], [2]], [[], []]), 0.0)
+ self._AssertConfidence(0.0, [], [1, 2])
+ self._AssertConfidence(0.0, [1, 2], [])
+ self._AssertConfidence(0.0, [1], [1, 2])
+ self._AssertConfidence(0.0, [1, 2], [1])
def testConfidenceScore_ZeroConfidence(self):
# The good and bad sets contain the same values, so the confidence that