code: def test_get_hash_cached_file(tmp_dir, dvc, mocker):
      tmp_dir.dvc_gen({"foo": "foo"})
      fs = DVCFileSystem(repo=dvc)
      expected = "acbd18db4cc2f85cedef654fccc4a4d8"
      assert fs.info("foo").get("md5") is None
      _, _, obj = build(dvc.cache.local, "foo", fs, "md5")
      assert obj.hash_info == HashInfo("md5", expected)
      (tmp_dir / "foo").unlink()
      assert fs.info("foo")["md5"] == expected
  
imports: import os
  import posixpath
  import shutil
  import pytest
  from fsspec.utils import tokenize
  from dvc.fs import localfs
  from dvc.fs.dvc import DVCFileSystem
  from dvc.testing.tmp_dir import make_subrepo
  from dvc_data.hashfile.build import build
  from dvc_data.hashfile.hash_info import HashInfo
label_desc: Use image node_id 22 for calling a global function with example usage: test_get_hash_cached_file(tmp_dir, dvc, mocker) without return types