Index: build/android/pylib/device/battery_utils_test.py |
diff --git a/build/android/pylib/device/battery_utils_test.py b/build/android/pylib/device/battery_utils_test.py |
index ec81e39684f232f69f1b14c7af576ca5840ab324..32c168b904bcd6cef88ad19a9fa6734c6a360b95 100755 |
--- a/build/android/pylib/device/battery_utils_test.py |
+++ b/build/android/pylib/device/battery_utils_test.py |
@@ -141,6 +141,17 @@ class BatteryUtilsGetPowerData(BatteryUtilsTest): |
self.assertEqual(data, {'uid': '1001', 'data': [2.0]}) |
+class BatteryUtilsChargeDevice(BatteryUtilsTest): |
+ |
+ @mock.patch('time.sleep', mock.Mock()) |
+ def testChargeDeviceToLevel(self): |
+ with self.assertCalls( |
+ (self.call.battery.SetCharging(True)), |
+ (self.call.battery.GetBatteryInfo(), {'level': '50'}), |
+ (self.call.battery.GetBatteryInfo(), {'level': '100'})): |
+ self.battery.ChargeDeviceToLevel(95) |
+ |
+ |
if __name__ == '__main__': |
logging.getLogger().setLevel(logging.DEBUG) |
unittest.main(verbosity=2) |