code: def test_cache_load_bad_dir_cache(tmp_dir, dvc):
      from dvc_data.hashfile import load
  
      dir_hash = "123.dir"
      fname = os.fspath(dvc.cache.local.oid_to_path(dir_hash))
      tmp_dir.gen({fname: "<clearly>not,json"})
      with pytest.raises(ObjectFormatError):
          load(dvc.cache.local, HashInfo("md5", dir_hash))
  
      dir_hash = "234.dir"
      fname = os.fspath(dvc.cache.local.oid_to_path(dir_hash))
      tmp_dir.gen({fname: '{"a": "b"}'})
      with pytest.raises(ObjectFormatError):
          load(dvc.cache.local, HashInfo("md5", dir_hash))
  
file_path: dvc/tests/func/test_odb.py
imports: import os
  import stat
  import configobj
  import pytest
  from dvc.cachemgr import CacheManager
  from dvc.cli import main
  from dvc.utils import relpath
  from dvc_data.hashfile.hash_info import HashInfo
  from dvc_objects.errors import ObjectFormatError
label_desc: Use image node_id 2 for calling a global function with example usage: test_cache_load_bad_dir_cache(tmp_dir, dvc) without return types