code: def test__download_compute_worker_run_artifact_by_type(
      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_artifact_by_type(
          run=run,
          artifact_type=DockerRunArtifactType.CHECKPOINT,
          output_path="output_dir/checkpoint.ckpt",
          timeout=0,
      )
      mock_download_compute_worker_run_artifact.assert_called_once_with(
          run_id=run_id,
          artifact_id=artifact_ids[1],
          output_path="output_dir/checkpoint.ckpt",
          timeout=0,
      )
  
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 2 for calling a global function with example usage: test__download_compute_worker_run_artifact_by_type(mocker) without return types