code: def test_list_apps_on_cluster(
      list_memberships: mock.MagicMock, list_instances: mock.MagicMock
  ):
      list_memberships.return_value = V1ListMembershipsResponse(
          memberships=[V1Membership(project_id="default-project")]
      )
      list_instances.return_value = V1ListLightningappInstancesResponse(
          lightningapps=[]
      )
  
      cluster_manager = _AppManager()
      cluster_manager.list()
  
      list_memberships.assert_called_once()
      list_instances.assert_called_once_with(
          project_id="default-project", limit=100, phase_in=[]
      )
  
file_path: pytorch-lightning/tests/tests_app/cli/test_cmd_apps.py
imports: from unittest import mock
  from unittest.mock import MagicMock
  import pytest
  from lightning.app.cli.cmd_apps import _AppList, _AppManager
  from lightning_cloud.openapi import Externalv1LightningappInstance, V1LightningappInstanceSpec, V1LightningappInstanceState, V1LightningappInstanceStatus, V1LightningworkState, V1ListLightningappInstancesResponse, V1ListLightningworkResponse, V1ListMembershipsResponse, V1Membership
  from rich.text import Text
label_desc: Use image node_id 6 for calling a global function with example usage: test_list_apps_on_cluster(list_memberships, list_instances) without return types