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

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

Issue 420273006: [Android] Fix DeviceUtils.__str__ when no serial is provided. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « build/android/pylib/device/device_utils.py ('k') | chrome/test/chromedriver/test/test_environment.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 b6a99d28d4bb7fb85a0a0b00c37283a1063d2d26..2692e1255b801a5961980f47956c8e8fb9616f63 100755
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -1484,6 +1484,17 @@ class DeviceUtilsStrTest(DeviceUtilsOldImplTest):
with self.assertNoAdbCalls():
self.assertEqual('0123456789abcdef', str(self.device))
+ def testStr_noSerial(self):
+ 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 self.assertCalls('adb get-serialno', 'unknown'), (
+ self.assertRaises(device_errors.NoDevicesError)):
+ str(self.device)
+
if __name__ == '__main__':
logging.getLogger().setLevel(logging.DEBUG)
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | chrome/test/chromedriver/test/test_environment.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698