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

Side by Side Diff: build/android/pylib/device/device_utils_test.py

Issue 944673002: [Android] Raise NoDevicesError in DeviceUtils.parallel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ 6 """
7 Unit tests for the contents of device_utils.py (mostly DeviceUtils). 7 Unit tests for the contents of device_utils.py (mostly DeviceUtils).
8 """ 8 """
9 9
10 # pylint: disable=C0321 10 # pylint: disable=C0321
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 with self.assertCall( 1397 with self.assertCall(
1398 mock.call.pylib.device.adb_wrapper.AdbWrapper.GetDevices(), 1398 mock.call.pylib.device.adb_wrapper.AdbWrapper.GetDevices(),
1399 [_AdbWrapperMock(serial) for serial in test_serials]): 1399 [_AdbWrapperMock(serial) for serial in test_serials]):
1400 parallel_devices = device_utils.DeviceUtils.parallel() 1400 parallel_devices = device_utils.DeviceUtils.parallel()
1401 for serial, device in zip(test_serials, parallel_devices.pGet(None)): 1401 for serial, device in zip(test_serials, parallel_devices.pGet(None)):
1402 self.assertTrue( 1402 self.assertTrue(
1403 isinstance(device, device_utils.DeviceUtils) 1403 isinstance(device, device_utils.DeviceUtils)
1404 and serial == str(device), 1404 and serial == str(device),
1405 'Expected a DeviceUtils object with serial %s' % serial) 1405 'Expected a DeviceUtils object with serial %s' % serial)
1406 1406
1407 def testParallel_noDevices(self):
1408 with self.assertCall(
1409 mock.call.pylib.device.adb_wrapper.AdbWrapper.GetDevices(), []):
1410 with self.assertRaises(device_errors.NoDevicesError):
1411 device_utils.DeviceUtils.parallel()
1412
1407 1413
1408 if __name__ == '__main__': 1414 if __name__ == '__main__':
1409 logging.getLogger().setLevel(logging.DEBUG) 1415 logging.getLogger().setLevel(logging.DEBUG)
1410 unittest.main(verbosity=2) 1416 unittest.main(verbosity=2)
1411 1417
OLDNEW
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698