code: def test_download_dataset__ok(mocker: MockerFixture) -> None:
      dataset_id = utils.generate_id()
  
      mocked_get_dataset_by_id = mocker.MagicMock(
          return_value=DatasetData(
              name="dataset",
              id=dataset_id,
              user_id=utils.generate_id(),
              last_modified_at=0,
              type=DatasetType.IMAGES,
              img_type=ImageType.FULL,
              size_in_bytes=-1,
              n_samples=-1,
              created_at=0,
          )
      )
      mocked_datasets_api = mocker.MagicMock()
      mocked_datasets_api.get_dataset_by_id = mocked_get_dataset_by_id
  
      mocked_get_sample_mappings_by_dataset_id = mocker.MagicMock(
          return_value=[1]
      )
      mocked_mappings_api = mocker.MagicMock()
      mocked_mappings_api.get_sample_mappings_by_dataset_id = (
          mocked_get_sample_mappings_by_dataset_id
      )
  
      mocked_get_sample_image_read_url_by_id = mocker.MagicMock(
          side_effect=RuntimeError("some error")
      )
      mocked_samples_api = mocker.MagicMock()
      mocked_samples_api.get_sample_image_read_url_by_id = (
          mocked_get_sample_image_read_url_by_id
      )
  
      mocker.patch.object(
          ApiWorkflowClient, "__init__", return_value=None
      )
      mocker.patch.object(
          ApiWorkflowClient,
          "get_all_tags",
          return_value=[
              TagData(
                  id=utils.generate_id(),
                  dataset_id=dataset_id,
                  prev_tag_id=None,
                  bit_mask_data="0x1",
                  name="some-tag",
                  tot_size=4,
                  created_at=1577836800,
                  changes=[],
              )
          ],
      )
      mocker.patch.object(
          ApiWorkflowClient,
          "get_filenames",
          return_value=[f"file{i}" for i in range(3)],
      )
      mocker.patch.object(
          api_workflow_download_dataset, "_get_image_from_read_url"
      )
      mocker.patch.object(
          api_workflow_download_dataset, "_make_dir_and_save_image"
      )
      mocked_warning = mocker.patch("warnings.warn")
      mocker.patch("tqdm.tqdm")
      mocked_executor = mocker.patch.object(
          api_workflow_download_dataset, "ThreadPoolExecutor"
      )
      mocked_executor.return_value.__enter__.return_value.map = (
          lambda fn, iterables, **_: map(fn, iterables)
      )
  
      client = ApiWorkflowClient()
      client._dataset_id = "dataset-id"
      client._datasets_api = mocked_datasets_api
      client._mappings_api = mocked_mappings_api
      client._samples_api = mocked_samples_api
  
      client.download_dataset(
          output_dir="path/to/dir", tag_name="some-tag"
      )
  
      assert mocked_warning.call_count == 2
      warning_text = [
          str(call_args[0][0])
          for call_args in mocked_warning.call_args_list
      ]
      assert warning_text == [
          "Downloading of image file0 failed with error some error",
          "Warning: Unsuccessful download! Failed at image: 0",
      ]
  
file_path: lightly/tests/api_workflow/test_api_workflow_download_dataset.py
imports: import pytest
  from pytest_mock import MockerFixture
  from lightly.api import ApiWorkflowClient, api_workflow_download_dataset
  from lightly.openapi_generated.swagger_client.models import DatasetData, DatasetEmbeddingData, DatasetType, ImageType, TagData
  from tests.api_workflow import utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_download_dataset__ok(mocker) without return types