code: def test_download_compute_worker_run_artifacts(
      mocker: MockerFixture,
  ) -> None:
      client = ApiWorkflowClient(token="123")
      mock_download_compute_worker_run_artifact = mocker.MagicMock(
          spec_set=client._download_compute_worker_run_artifact
      )
      client._download_compute_worker_run_artifact = (
          mock_download_compute_worker_run_artifact
      )
      run_id = utils.generate_id()
      artifact_ids = [utils.generate_id(), utils.generate_id()]
      run = DockerRunData(
          id=run_id,
          user_id="user-id",
          dataset_id=utils.generate_id(),
          docker_version="",
          state=DockerRunState.COMPUTING_METADATA,
          created_at=0,
          last_modified_at=0,
          artifacts=[
              DockerRunArtifactData(
                  id=artifact_ids[0],
                  file_name="report.pdf",
                  type=DockerRunArtifactType.REPORT_PDF,
              ),
              DockerRunArtifactData(
                  id=artifact_ids[1],
                  file_name="checkpoint.ckpt",
                  type=DockerRunArtifactType.CHECKPOINT,
              ),
          ],
      )
      client.download_compute_worker_run_artifacts(
          run=run, output_dir="output_dir"
      )
      calls = [
          mocker.call(
              run_id=run_id,
              artifact_id=artifact_ids[0],
              output_path="output_dir/report.pdf",
              timeout=60,
          ),
          mocker.call(
              run_id=run_id,
              artifact_id=artifact_ids[1],
              output_path="output_dir/checkpoint.ckpt",
              timeout=60,
          ),
      ]
      mock_download_compute_worker_run_artifact.assert_has_calls(
          calls=calls
      )
      assert (
          mock_download_compute_worker_run_artifact.call_count
          == len(calls)
      )
  
file_path: lightly/tests/api_workflow/test_api_workflow_artifacts.py
imports: import pytest
  from pytest_mock import MockerFixture
  from lightly.api import ApiWorkflowClient, ArtifactNotExist
  from lightly.openapi_generated.swagger_client.api import DockerApi
  from lightly.openapi_generated.swagger_client.models import DockerRunArtifactData, DockerRunArtifactType, DockerRunData, DockerRunState
  from tests.api_workflow import utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_download_compute_worker_run_artifacts(mocker) without return types