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

Side by Side Diff: build/android/devil/utils/parallelizer_test.py

Issue 1314913009: [Android] Move some pylib modules into devil/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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 unified diff | Download patch
« no previous file with comments | « build/android/devil/utils/parallelizer.py ('k') | build/android/devil/utils/reraiser_thread.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 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 """Unit tests for the contents of parallelizer.py.""" 5 """Unit tests for the contents of parallelizer.py."""
6 6
7 # pylint: disable=W0212 7 # pylint: disable=W0212
8 # pylint: disable=W0613 8 # pylint: disable=W0613
9 9
10 import os 10 import os
11 import tempfile 11 import tempfile
12 import time 12 import time
13 import unittest 13 import unittest
14 14
15 from pylib.utils import parallelizer 15 from devil.utils import parallelizer
16 16
17 17
18 class ParallelizerTestObject(object): 18 class ParallelizerTestObject(object):
19 """Class used to test parallelizer.Parallelizer.""" 19 """Class used to test parallelizer.Parallelizer."""
20 20
21 parallel = parallelizer.Parallelizer 21 parallel = parallelizer.Parallelizer
22 22
23 def __init__(self, thing, completion_file_name=None): 23 def __init__(self, thing, completion_file_name=None):
24 self._thing = thing 24 self._thing = thing
25 self._completion_file_name = completion_file_name 25 self._completion_file_name = completion_file_name
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 def testGetItem(self): 158 def testGetItem(self):
159 devices = [ParallelizerTestObject(range(i, i+10)) for i in xrange(0, 10)] 159 devices = [ParallelizerTestObject(range(i, i+10)) for i in xrange(0, 10)]
160 results = ParallelizerTestObject.parallel(devices)[9].pGet(1) 160 results = ParallelizerTestObject.parallel(devices)[9].pGet(1)
161 self.assertEquals(range(9, 19), results) 161 self.assertEquals(range(9, 19), results)
162 162
163 163
164 if __name__ == '__main__': 164 if __name__ == '__main__':
165 unittest.main(verbosity=2) 165 unittest.main(verbosity=2)
166 166
OLDNEW
« no previous file with comments | « build/android/devil/utils/parallelizer.py ('k') | build/android/devil/utils/reraiser_thread.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698