code: def test_list_components(
      list_memberships: mock.MagicMock, list_components: mock.MagicMock
  ):
      list_memberships.return_value = V1ListMembershipsResponse(
          memberships=[V1Membership(project_id="default-project")]
      )
      list_components.return_value = V1ListLightningworkResponse(
          lightningworks=[]
      )
  
      cluster_manager = _AppManager()
      cluster_manager.list_components(app_id="cheese")
  
      list_memberships.assert_called_once()
      list_components.assert_called_once_with(
          project_id="default-project", app_id="cheese", 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 4 for calling a global function with example usage: test_list_components(list_memberships, list_components) without return types