code: def test_get_hash_dir(tmp_dir, dvc, mocker):
      tmp_dir.dvc_gen(
          {
              "dir": {
                  "foo": "foo",
                  "bar": "bar",
                  "subdir": {"data": "data"},
              }
          }
      )
      fs = DataFileSystem(index=dvc.index.data["repo"])
      hash_file_spy = mocker.spy(dvc_data.hashfile.hash, "hash_file")
      assert (
          fs.info("dir")["md5"]
          == "8761c4e9acad696bee718615e23e22db.dir"
      )
      assert not hash_file_spy.called
  
imports: import posixpath
  import shutil
  import pytest
  import dvc_data
  from dvc.fs import localfs
  from dvc.fs.data import DataFileSystem
  from dvc.utils.fs import remove
  from dvc_data.hashfile.build import build
  from dvc_data.hashfile.hash_info import HashInfo
label_desc: Use image node_id 15 for calling a global function with example usage: test_get_hash_dir(tmp_dir, dvc, mocker) without return types