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

Unified Diff: tools/auto_bisect/bisect_state_test.py

Issue 664753002: Refactored auto_bisect bot (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/auto_bisect/bisect_state.py ('k') | tools/auto_bisect/bisect_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/auto_bisect/bisect_state_test.py
diff --git a/tools/auto_bisect/bisect_state_test.py b/tools/auto_bisect/bisect_state_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..0630fab5eb749ace83d464e3d6eb13d20c053f6f
--- /dev/null
+++ b/tools/auto_bisect/bisect_state_test.py
@@ -0,0 +1,31 @@
+# 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
+
+from bisect_state import BisectState
+
+
+class BisectStateTest(unittest.TestCase):
+
+ def testCreatesRevisionsStateAfterAReferenceRevision(self):
+ bisect_state = BisectState('chromium', ['a', 'b', 'c', 'd'])
+ bisect_state.CreateRevisionStatesAfter('webkit', [1, 2, 3], 'chromium', 'b')
+ bisect_state.CreateRevisionStatesAfter('v8', [100, 200], 'webkit', 2)
+
+ actual_revisions = bisect_state.GetRevisionStates()
+ expected_revisions = [('chromium', 'a'), ('chromium', 'b'), ('webkit', 1),
+ ('webkit', 2), ('v8', 100), ('v8', 200),
+ ('webkit', 3), ('chromium', 'c'), ('chromium', 'd')]
+ self.assertEqual(len(expected_revisions), len(actual_revisions))
+ for i in xrange(len(actual_revisions)):
+ self.assertEqual(i, actual_revisions[i].index)
+ self.assertEqual(expected_revisions[i][0], actual_revisions[i].depot)
+ self.assertEqual(expected_revisions[i][1], actual_revisions[i].revision)
+
+ # TODO(sergiyb): More tests for the remaining functions.
+
+
+if __name__ == '__main__':
+ unittest.main()
« no previous file with comments | « tools/auto_bisect/bisect_state.py ('k') | tools/auto_bisect/bisect_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698