def installed_app_info_from_json(data: str) -> "InstalledAppInfo": parsed = json.loads(data) return InstalledAppInfo( bundle_id=parsed["bundle_id"], name=parsed["name"], install_type=parsed["install_type"], architectures=set(parsed["architectures"]), process_state=app_process_string_to_state(parsed["process_state"]), debuggable=parsed["debuggable"], )
async def list_apps(self) -> List[InstalledAppInfo]: response = await self.stub.list_apps(ListAppsRequest()) return [ InstalledAppInfo( bundle_id=app.bundle_id, name=app.name, architectures=app.architectures, install_type=app.install_type, process_state=AppProcessState(app.process_state), debuggable=app.debuggable, ) for app in response.apps ]
TEST_ACTIVITY_FIXTURE = TestActivity(title="ActivityTitle", duration=8, uuid="MyUdid") TEST_RUN_INFO_FIXTURE = TestRunInfo( bundle_name="MyBundleName", class_name="MyClassName", method_name="MyMethodName", logs=["logA", "logB"], duration=12.34, passed=True, failure_info=None, activityLogs=[], crashed=False, ) INSTALLED_APP_INFO_FIXTURE = InstalledAppInfo( bundle_id="MyBundleId", name="MyName", architectures={"ArchA", "ArchB"}, install_type="System", process_state=AppProcessState.RUNNING, debuggable=True, ) COMPANION_INFO_FIXTURE = CompanionInfo( udid="MyUdid", host="ThisMac", port=1234, is_local=False, grpc_port=9 ) TARGET_DESCRIPTION_FIXTURE = TargetDescription( udid="MyUdid", name="MyName", state="Started?", target_type="iOS", os_version="1", architecture="arm89", companion_info=None, screen_dimensions=None,