Index: build/android/pylib/base/test_dispatcher_unittest.py |
diff --git a/build/android/pylib/base/test_dispatcher_unittest.py b/build/android/pylib/base/test_dispatcher_unittest.py |
index 88dfda69f01939a1253b8b7739a3207cf3dadcc2..c6078dbdfcfca6f0bb433067139f8158cd181920 100644 |
--- a/build/android/pylib/base/test_dispatcher_unittest.py |
+++ b/build/android/pylib/base/test_dispatcher_unittest.py |
@@ -186,6 +186,15 @@ class TestShard(unittest.TestCase): |
self.assertEqual(len(results.GetAll()), 0) |
self.assertEqual(exit_code, constants.ERROR_EXIT_CODE) |
+ def testTestsRemainWithAllDevicesOffline(self): |
+ attached_devices = android_commands.GetAttachedDevices |
+ android_commands.GetAttachedDevices = lambda: [] |
+ try: |
+ with self.assertRaises(AssertionError): |
+ results, exit_code = TestShard._RunShard(MockRunner) |
+ finally: |
+ android_commands.GetAttachedDevices = attached_devices |
+ |
class TestReplicate(unittest.TestCase): |
"""Tests test_dispatcher.RunTests with replication.""" |