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

Side by Side Diff: build/android/pylib/base/shard_unittest.py

Issue 12327025: [Android] fix the pylib/base/shard.py unittest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Unittests for shard.py.""" 5 """Unittests for shard.py."""
6 6
7 import os 7 import os
8 import sys 8 import sys
9 import unittest 9 import unittest
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 class TestWorker(unittest.TestCase): 46 class TestWorker(unittest.TestCase):
47 """Tests for shard._Worker.""" 47 """Tests for shard._Worker."""
48 @staticmethod 48 @staticmethod
49 def _RunRunner(mock_runner, tests): 49 def _RunRunner(mock_runner, tests):
50 results = [] 50 results = []
51 retry = [] 51 retry = []
52 worker = shard._Worker(mock_runner, tests, results, retry) 52 worker = shard._Worker(mock_runner, tests, results, retry)
53 worker.start() 53 worker.start()
54 worker.join() 54 worker.join()
55 worker.Reraise() 55 worker.ReraiseIfException()
56 return (results, retry) 56 return (results, retry)
57 57
58 def testRun(self): 58 def testRun(self):
59 results, retry = TestWorker._RunRunner(MockRunner(), ['a', 'b']) 59 results, retry = TestWorker._RunRunner(MockRunner(), ['a', 'b'])
60 self.assertEqual(len(results), 2) 60 self.assertEqual(len(results), 2)
61 self.assertEqual(len(retry), 0) 61 self.assertEqual(len(retry), 0)
62 62
63 def testRetry(self): 63 def testRetry(self):
64 results, retry = TestWorker._RunRunner(MockRunnerRetry(), ['a', 'b']) 64 results, retry = TestWorker._RunRunner(MockRunnerRetry(), ['a', 'b'])
65 self.assertEqual(len(results), 2) 65 self.assertEqual(len(results), 2)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 self.assertEqual(len(results.ok), 3) 107 self.assertEqual(len(results.ok), 3)
108 108
109 def testFailing(self): 109 def testFailing(self):
110 results = TestShard._RunShard(MockRunnerRetry) 110 results = TestShard._RunShard(MockRunnerRetry)
111 self.assertEqual(len(results.ok), 0) 111 self.assertEqual(len(results.ok), 0)
112 self.assertEqual(len(results.failed), 3) 112 self.assertEqual(len(results.failed), 3)
113 113
114 114
115 if __name__ == '__main__': 115 if __name__ == '__main__':
116 unittest.main() 116 unittest.main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698