示例#1
0
def reboot():
    parse()
    device = getArgs().device
    platform = getArgs().platform
    if platform.startswith("ios"):
        util = IDB(device)
    elif platform.startswith("android"):
        util = ADB(device)
    else:
        assert False, "Platform {} not recognized".format(platform)
    util.reboot()
    print("Reboot Success")
示例#2
0
def reboot(**kwargs):
    raw_args = kwargs.get("raw_args", None)
    args, _ = parser.parse_known_args(raw_args)
    device = args.device
    platform = args.platform
    if platform.startswith("ios"):
        util = IDB(device)
    elif platform.startswith("android"):
        util = ADB(device, args.android_dir)
    else:
        raise AssertionError("Platform {} not recognized".format(platform))
    util.reboot()
    print("Reboot Success")
示例#3
0
 def test_reboot(self):
     idb = IDB(device="TEST_DEVICE")
     with patch(
             "platforms.platform_util_base.PlatformUtilBase.run",
             side_effect=self._ios_run_for_reboot,
     ):
         push_res = idb.reboot()
         self.assertTrue(push_res)