code: def test_copier_existence_check(tmpdir):
      """Test that the Copier responds to an existence check request."""
      copy_request_queue = _MockQueue()
      copy_response_queue = _MockQueue()
  
      work = mock.Mock()
      work.name = MockPatch()
      work._paths = {
          "file": {
              "source": "src",
              "path": str(tmpdir / "notexists"),
              "hash": "123",
              "destination": "dest",
              "name": "name",
          }
      }
  
      copier = _Copier(
          work,
          copy_request_queue=copy_request_queue,
          copy_response_queue=copy_response_queue,
      )
  
      # A Path that does NOT exist
      request = _ExistsRequest(
          source="src",
          path=str(tmpdir / "notexists"),
          destination="dest",
          name="name",
          hash="123",
      )
      copy_request_queue.put(request)
      copier.run_once()
      response = copy_response_queue.get()
      assert response.exists is False
  
      # A Path that DOES exist
      request = _ExistsRequest(
          source="src",
          path=str(tmpdir),
          destination="dest",
          name="name",
          hash="123",
      )
      copy_request_queue.put(request)
      copier.run_once()
      response = copy_response_queue.get()
      assert response.exists is True
  
file_path: pytorch-lightning/tests/tests_app/storage/test_copier.py
imports: import os
  import pathlib
  from unittest import mock
  from unittest.mock import Mock
  import lightning.app
  import pytest
  from lightning.app.storage.copier import _Copier, _copy_files
  from lightning.app.storage.path import Path
  from lightning.app.storage.requests import _ExistsRequest, _GetRequest
  from lightning.app.testing.helpers import _MockQueue
label_desc: Use image node_id 3 for calling a global function with example usage: test_copier_existence_check(tmpdir) without return types