code: def test_get_used_objs(exists, expected_message, mocker, caplog):
      stage = mocker.MagicMock()
      mocker.patch.object(
          stage, "__str__", return_value="stage: 'stage.dvc'"
      )
      mocker.patch.object(stage, "addressing", "stage.dvc")
      mocker.patch.object(stage, "wdir", os.getcwd())
      mocker.patch.object(stage.repo, "root_dir", os.getcwd())
      mocker.patch.object(
          stage.repo.dvcignore, "is_ignored", return_value=False
      )
      mocker.patch.object(
          stage.repo.dvcignore,
          "check_ignore",
          return_value=_no_match("path"),
      )
      stage.repo.fs.version_aware = False
      stage.repo.fs.PARAM_CHECKSUM = "md5"
  
      output = Output(stage, "path")
  
      mocker.patch.object(output, "use_cache", True)
      mocker.patch.object(stage, "is_repo_import", False)
      mocker.patch.object(
          Output, "exists", new_callable=mocker.PropertyMock
      ).return_value = exists
  
      with caplog.at_level(logging.WARNING, logger="dvc"):
          assert {} == output.get_used_objs()
      assert first(caplog.messages) == expected_message
  
file_path: dvc/tests/unit/output/test_output.py
imports: import logging
  import os
  import pytest
  from funcy import first
  from voluptuous import MultipleInvalid, Schema
  from dvc.fs import RemoteMissingDepsError
  from dvc.ignore import _no_match
  from dvc.output import CHECKSUM_SCHEMA, Output
  from dvc.stage import Stage
  from dvc.utils.fs import remove
label_desc: Use image node_id 4 for calling a global function with example usage: test_get_used_objs(exists, expected_message, mocker, caplog) without return types