code: def test_cp_zip_remote_to_local_cloudspace_artifact(monkeypatch):
      assert cd("/", verify=False) == "/"
  
      token_getter = MagicMock()
      token_getter._get_api_token.return_value = "my-token"
      monkeypatch.setattr(
          cp, "_AuthTokenGetter", MagicMock(return_value=token_getter)
      )
  
      client = MagicMock()
      client.cluster_service_list_clusters.return_value = (
          V1ListClustersResponse(
              default_cluster="my-cluster",
              clusters=[
                  Externalv1Cluster(
                      id="my-cluster",
                      spec=V1ClusterSpec(
                          driver=V1ClusterDriver(
                              kubernetes=V1KubernetesClusterDriver(
                                  root_domain_name="my-domain"
                              )
                          )
                      ),
                  )
              ],
          )
      )
      client.projects_service_list_memberships.return_value = (
          V1ListMembershipsResponse(
              memberships=[
                  V1Membership(
                      name="my-project", project_id="my-project-id"
                  )
              ]
          )
      )
      client.cloud_space_service_list_cloud_spaces.return_value = (
          V1ListCloudSpacesResponse(
              cloudspaces=[
                  V1CloudSpace(
                      name="my-cloudspace", id="my-cloudspace-id"
                  )
              ],
          )
      )
      monkeypatch.setattr(
          cp, "LightningClient", MagicMock(return_value=client)
      )
  
      download_file = MagicMock()
      monkeypatch.setattr(cp, "_download_file", download_file)
  
      cloudspace_artifact = "r:/my-project/my-cloudspace/my-artifact"
      cp.cp(cloudspace_artifact, ".", zip=True)
  
      download_file.assert_called_once()
      assert (
          download_file.call_args_list[0].args[0] == "./my-artifact.zip"
      )
      assert (
          download_file.call_args_list[0].args[1]
          == "https://storage.my-domain/v1/projects/my-project-id/artifacts/download"
          + "?prefix=/cloudspaces/my-cloudspace-id/my-artifact&token=my-token"
      )
  
file_path: pytorch-lightning/tests/tests_app/cli/test_cp.py
imports: import os
  import sys
  from pathlib import PosixPath
  from unittest.mock import MagicMock
  import pytest
  from lightning.app.cli.commands import cp
  from lightning.app.cli.commands.cd import _CD_FILE, cd
  from lightning_cloud.openapi import Externalv1Cluster, Externalv1LightningappInstance, V1CloudSpace, V1ClusterDriver, V1ClusterSpec, V1GetClusterResponse, V1KubernetesClusterDriver, V1LightningappInstanceArtifact, V1LightningappInstanceSpec, V1ListCloudSpacesResponse, V1ListClustersResponse, V1ListLightningappInstanceArtifactsResponse, V1ListLightningappInstancesResponse, V1ListMembershipsResponse, V1ListProjectClusterBindingsResponse, V1Membership, V1ProjectClusterBinding, V1UploadProjectArtifactResponse
label_desc: Use image node_id 6 for calling a global function with example usage: test_cp_zip_remote_to_local_cloudspace_artifact(monkeypatch) without return types