code: def test_match_ignore_from_file(
      file_to_ignore_relpath, patterns, expected_match, mocker
  ):
      from dvc.fs import localfs
  
      dvcignore_path = os.path.join(
          os.path.sep,
          "full",
          "path",
          "to",
          "ignore",
          "file",
          ".dvcignore",
      )
      dvcignore_dirname = os.path.dirname(dvcignore_path)
  
      mocker.patch.object(
          localfs,
          "open",
          mocker.mock_open(read_data="\n".join(patterns)),
      )
      ignore_file = DvcIgnorePatterns.from_file(
          dvcignore_path, localfs, "mocked"
      )
  
      assert (
          ignore_file.matches(dvcignore_dirname, file_to_ignore_relpath)
          == expected_match
      )
  
imports: import os
  import pytest
  from dvc.ignore import DvcIgnorePatterns
label_desc: Use image node_id 1 for calling a global function with example usage: test_match_ignore_from_file(file_to_ignore_relpath, patterns, expected_match, mocker) without return types