本文整理汇总了Python中uiautomator.AutomatorServer.push方法的典型用法代码示例。如果您正苦于以下问题:Python AutomatorServer.push方法的具体用法?Python AutomatorServer.push怎么用?Python AutomatorServer.push使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uiautomator.AutomatorServer
的用法示例。
在下文中一共展示了AutomatorServer.push方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_push
# 需要导入模块: from uiautomator import AutomatorServer [as 别名]
# 或者: from uiautomator.AutomatorServer import push [as 别名]
def test_push(self):
jars = ["bundle.jar", "uiautomator-stub.jar"]
server = AutomatorServer()
server.adb = MagicMock()
self.assertEqual(set(server.push()), set(jars))
for args in server.adb.cmd.call_args_list:
self.assertEqual(args[0][0], "push")
self.assertEqual(args[0][2], "/data/local/tmp/")
示例2: test_start_success
# 需要导入模块: from uiautomator import AutomatorServer [as 别名]
# 或者: from uiautomator.AutomatorServer import push [as 别名]
def test_start_success(self):
server = AutomatorServer()
server.push = MagicMock()
server.push.return_value = ["bundle.jar", "uiautomator-stub.jar"]
server.ping = MagicMock()
server.ping.return_value = "pong"
server.adb = MagicMock()
server.start()
server.adb.cmd.assert_valled_onec_with('shell', 'uiautomator', 'runtest', 'bundle.jar', 'uiautomator-stub.jar', '-c', 'com.github.uiautomatorstub.Stub')
示例3: test_start_error
# 需要导入模块: from uiautomator import AutomatorServer [as 别名]
# 或者: from uiautomator.AutomatorServer import push [as 别名]
def test_start_error(self):
server = AutomatorServer()
server.push = MagicMock()
server.push.return_value = ["bundle.jar", "uiautomator-stub.jar"]
server.ping = MagicMock()
server.ping.return_value = None
server.adb = MagicMock()
with patch("time.sleep"):
with self.assertRaises(IOError):
server.start()