Пример #1
0
 async def test_swipe_without_delta(self) -> None:
     self.client_mock().swipe = AsyncMock(return_value=[])
     await cli_main(cmd_input=["ui", "swipe", "1", "2", "3", "4"])
     self.client_mock().swipe.assert_called_once_with(
         p_start=(1, 2), p_end=(3, 4), delta=None
     )
Пример #2
0
 async def test_open_url(self) -> None:
     self.client_mock().open_url = AsyncMock(return_value=[])
     url = "http://facebook.com"
     await cli_main(cmd_input=["open", url])
     self.client_mock().open_url.assert_called_once_with(url)
Пример #3
0
 async def test_uninstall(self) -> None:
     self.client_mock().uninstall = AsyncMock()
     app_path = "com.dummy.app"
     await cli_main(cmd_input=["uninstall", app_path])
     self.client_mock().uninstall.assert_called_once_with(
         bundle_id=app_path)
Пример #4
0
 async def test_boot(self) -> None:
     self.client_mock().boot = AsyncMock()
     udid = "my udid"
     await cli_main(cmd_input=["boot", "--udid", udid])
     self.client_mock().boot.assert_called_once()
Пример #5
0
 async def test_install(self) -> None:
     self.client_mock().install = AsyncMock(return_value="com.foo.bar")
     app_path = "testApp.app"
     await cli_main(cmd_input=["install", app_path])
     self.client_mock().install.assert_called_once_with(app_path)
Пример #6
0
 async def test_kill(self) -> None:
     self.client_mock().kill = AsyncMock(return_value=[])
     await cli_main(cmd_input=["kill"])
     self.client_mock().kill.assert_called_once_with()
Пример #7
0
 async def test_xctest_list(self) -> None:
     self.client_mock().list_xctests = AsyncMock(return_value=[])
     await cli_main(cmd_input=["xctest", "list"])
     self.client_mock().list_xctests.assert_called_once()
Пример #8
0
 async def test_crash_delete_with_predicate(self) -> None:
     self.client_mock().crash_delete = AsyncMock(return_value=[])
     await cli_main(cmd_input=["crash", "delete", "--since", "20"])
     self.client_mock().crash_delete.assert_called_once_with(
         query=CrashLogQuery(since=20)
     )
Пример #9
0
 async def test_crash_delete_with_name(self) -> None:
     self.client_mock().crash_delete = AsyncMock(return_value=[])
     await cli_main(cmd_input=["crash", "delete", "some.foo.bar.crash"])
     self.client_mock().crash_delete.assert_called_once_with(
         query=CrashLogQuery(name="some.foo.bar.crash")
     )
Пример #10
0
 async def test_crash_list_all(self) -> None:
     self.client_mock().crash_list = AsyncMock(return_value=[])
     await cli_main(cmd_input=["crash", "list"])
     self.client_mock().crash_list.assert_called_once_with(query=CrashLogQuery())
Пример #11
0
 async def test_crash_show(self) -> None:
     self.client_mock().crash_show = AsyncMock()
     await cli_main(cmd_input=["crash", "show", "foo"])
     self.client_mock().crash_show.assert_called_once_with(name="foo")
Пример #12
0
 async def test_accessibility_info_at_point(self) -> None:
     self.client_mock().accessibility_info = AsyncMock()
     await cli_main(cmd_input=["ui", "describe-point", "10", "20"])
     self.client_mock().accessibility_info.assert_called_once_with(point=(10, 20))
Пример #13
0
 async def test_accessibility_info_all(self) -> None:
     self.client_mock().accessibility_info = AsyncMock()
     await cli_main(cmd_input=["ui", "describe-all"])
     self.client_mock().accessibility_info.assert_called_once_with(point=None)
Пример #14
0
 async def test_contacts_update(self) -> None:
     self.client_mock().contacts_update = AsyncMock(return_value=[])
     await cli_main(cmd_input=["contacts", "update", "/dev/null"])
     self.client_mock().contacts_update.assert_called_once_with(
         contacts_path="/dev/null"
     )
Пример #15
0
 async def test_file_rmpath_colon(self) -> None:
     self.client_mock().rm = AsyncMock()
     cmd_input = ["file", "remove", "com.bundle.id:path"]
     await cli_main(cmd_input=cmd_input)
     self.client_mock().rm.assert_called_once_with(
         bundle_id="com.bundle.id", paths=["path"])
Пример #16
0
 async def test_add_media(self) -> None:
     self.client_mock().add_media = AsyncMock(return_value=["aaa", "bbb"])
     file_paths = ["cat.jpeg", "dog.mov"]
     await cli_main(cmd_input=["add-media"] + file_paths)
     self.client_mock().add_media.assert_called_once_with(file_paths=file_paths)
Пример #17
0
 async def test_file_listpath_colon(self) -> None:
     self.client_mock().ls = AsyncMock(return_value=[])
     cmd_input = ["file", "list", "com.bundle.id:path"]
     await cli_main(cmd_input=cmd_input)
     self.client_mock().ls.assert_called_once_with(
         bundle_id="com.bundle.id", path="path")
Пример #18
0
 async def test_focus(self) -> None:
     self.client_mock().focus = AsyncMock(return_value=["aaa", "bbb"])
     await cli_main(cmd_input=["focus"])
     self.client_mock().focus.assert_called_once()
Пример #19
0
 async def test_xctest_install(self) -> None:
     self.client_mock().install_xctest = AsyncMock(return_value=[])
     test_bundle_path = "testBundle.xctest"
     await cli_main(cmd_input=["xctest", "install", test_bundle_path])
     self.client_mock().install_xctest.assert_called_once_with(
         test_bundle_path)
Пример #20
0
 async def test_debugserver_start(self) -> None:
     self.client_mock().debugserver_start = AsyncMock(return_value=["aaa", "bbb"])
     await cli_main(cmd_input=["debugserver", "start", "com.foo.bar"])
     self.client_mock().debugserver_start.assert_called_once_with(
         bundle_id="com.foo.bar"
     )
Пример #21
0
 async def test_xctest_list_bundles(self) -> None:
     self.client_mock().list_test_bundle = AsyncMock(return_value=[])
     bundle_id = "myBundleID"
     await cli_main(cmd_input=["xctest", "list-bundle", bundle_id])
     self.client_mock().list_test_bundle.assert_called_once_with(
         test_bundle_id=bundle_id)
Пример #22
0
 async def test_debugserver_status(self) -> None:
     self.client_mock().debugserver_status = AsyncMock(return_value=["aaa", "bbb"])
     await cli_main(cmd_input=["debugserver", "status"])
     self.client_mock().debugserver_status.assert_called_once()
Пример #23
0
 async def test_terminate(self) -> None:
     self.client_mock().terminate = AsyncMock(return_value=[])
     bundle_id = "com.foo.app"
     udid = "my udid"
     await cli_main(cmd_input=["terminate", bundle_id, "--udid", udid])
     self.client_mock().terminate.assert_called_once_with(bundle_id)
Пример #24
0
 async def test_disconnect_with_host_and_port(self) -> None:
     self.client_mock().disconnect = AsyncMock()
     host = "someHost"
     port = 1234
     await cli_main(cmd_input=["disconnect", host, str(port)])
     self.client_mock().disconnect.assert_called_once_with(destination=(host, port))
Пример #25
0
 async def test_clear_keychain(self) -> None:
     self.client_mock().clear_keychain = AsyncMock(return_value=[])
     await cli_main(cmd_input=["clear-keychain"])
     self.client_mock().clear_keychain.assert_called_once()
Пример #26
0
 async def test_disconnect_with_udid(self) -> None:
     self.client_mock().disconnect = AsyncMock()
     udid = "0B3311FA-234C-4665-950F-37544F690B61"
     await cli_main(cmd_input=["disconnect", udid])
     self.client_mock().disconnect.assert_called_once_with(destination=udid)
Пример #27
0
 async def test_approve(self) -> None:
     self.client_mock().approve = AsyncMock(return_value=[])
     bundle_id = "com.fb.myApp"
     await cli_main(cmd_input=["approve", bundle_id, "photos"])
     self.client_mock().approve.assert_called_once_with(
         bundle_id=bundle_id, permissions={"photos"})
Пример #28
0
 async def test_file_mkdir_colon(self) -> None:
     self.client_mock().mkdir = AsyncMock()
     cmd_input = ["file", "mkdir", "com.bundle.id:path"]
     await cli_main(cmd_input=cmd_input)
     self.client_mock().mkdir.assert_called_once_with(
         bundle_id="com.bundle.id", path="path")
Пример #29
0
 async def test_key_sequence(self) -> None:
     self.client_mock().key_sequence = AsyncMock(return_value=[])
     await cli_main(cmd_input=["ui", "key-sequence", "1", "2", "3"])
     self.client_mock().key_sequence.assert_called_once_with(
         key_sequence=[1, 2, 3])
Пример #30
0
 async def test_text_input(self) -> None:
     self.client_mock().text = AsyncMock(return_value=[])
     text = "Some Text"
     await cli_main(cmd_input=["ui", "text", text])
     self.client_mock().text.assert_called_once_with(text=text)