本文整理匯總了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()