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

Unified Diff: build/android/pylib/device/device_utils_test.py

Issue 711113002: Add option to specify ADB binary in test runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed mocking AdbGetPath. Created 6 years, 1 month 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 | « build/android/pylib/device/adb_wrapper.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/device_utils_test.py
diff --git a/build/android/pylib/device/device_utils_test.py b/build/android/pylib/device/device_utils_test.py
index 1fb973bd212f6dcf1ce8cb9c441f1cb09fe4155f..47c3f85682ec36014f7c0c01dba84c3187f3741c 100755
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -215,8 +215,10 @@ class DeviceUtilsOldImplTest(unittest.TestCase):
return type(self).AndroidCommandsCalls(self, cmd_ret, comp)
def setUp(self):
- self.device = device_utils.DeviceUtils(
- '0123456789abcdef', default_timeout=1, default_retries=0)
+ with mock.patch('pylib.constants.GetAdbPath',
jbudorick 2014/11/19 19:58:46 why not patch it in setUp and unpatch it in tearDo
+ mock.Mock(return_value='adb')):
+ self.device = device_utils.DeviceUtils(
+ '0123456789abcdef', default_timeout=1, default_retries=0)
class DeviceUtilsNewImplTest(mock_calls.TestCase):
@@ -1608,12 +1610,16 @@ class DeviceUtilsStrTest(DeviceUtilsOldImplTest):
self.assertEqual('0123456789abcdef', str(self.device))
def testStr_noSerial(self):
- self.device = device_utils.DeviceUtils(None)
+ with mock.patch('pylib.constants.GetAdbPath',
+ mock.Mock(return_value='adb')):
+ self.device = device_utils.DeviceUtils(None)
with self.assertCalls('adb get-serialno', '0123456789abcdef'):
self.assertEqual('0123456789abcdef', str(self.device))
def testStr_noSerial_noDevices(self):
- self.device = device_utils.DeviceUtils(None)
+ with mock.patch('pylib.constants.GetAdbPath',
+ mock.Mock(return_value='adb')):
+ self.device = device_utils.DeviceUtils(None)
with self.assertCalls('adb get-serialno', 'unknown'), (
self.assertRaises(device_errors.NoDevicesError)):
str(self.device)
« no previous file with comments | « build/android/pylib/device/adb_wrapper.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698